The slack rtm client handles reconnections automatically, but when it does so, subscriptions for presence_change events are lost. This means after one or more autoReconnects, presenceChange events will not fire.
Fix: I've taken a stab at fixing this in a fork and confirmed it works as expected. I'm not a javascript/ coffeescript programmer tho, so I had a scoping issue with @presenceSub in bot.coffee that I got around by inlining.. kippr@c35a109
What type of issue is this? (place an x in one of the [ ])
Requirements (place an x in each of the [ ])
Bug Report
Reproducible in:
hubot-slack version: 4.7.1
node version:
OS version(s):
Steps to reproduce:
The simplest way to see this is to watch the debug logs, but you can also create a simple hubot script that does something on presence changes. (robot.presenceChange (msg) callback)
- Connect hubot to your slack instance
- Start the slack client
- monitor for 'Received presence change update message [..]' in debug logs for your connection/ disconnection events by starting/ quitting client
- use tcpkill or some other tool to disrupt hubot's connection to slack; hubot will reconnect
- monitor for same presence change messages
Expected result:
The messages should keep firing.
Actual result:
They don't because the subscriptions for presence change events don't get created on the new connection.
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
The slack rtm client handles reconnections automatically, but when it does so, subscriptions for presence_change events are lost. This means after one or more autoReconnects, presenceChange events will not fire.
Fix: I've taken a stab at fixing this in a fork and confirmed it works as expected. I'm not a javascript/ coffeescript programmer tho, so I had a scoping issue with @presenceSub in bot.coffee that I got around by inlining.. kippr@c35a109
What type of issue is this? (place an
xin one of the[ ])Requirements (place an
xin each of the[ ])Bug Report
Reproducible in:
hubot-slack version: 4.7.1
node version:
OS version(s):
Steps to reproduce:
The simplest way to see this is to watch the debug logs, but you can also create a simple hubot script that does something on presence changes. (robot.presenceChange (msg) callback)
Expected result:
The messages should keep firing.
Actual result:
They don't because the subscriptions for presence change events don't get created on the new connection.
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.