Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presenceSub needs to re-run on reconnections #576

Open
4 of 9 tasks
kippr opened this issue Sep 24, 2019 · 0 comments
Open
4 of 9 tasks

presenceSub needs to re-run on reconnections #576

kippr opened this issue Sep 24, 2019 · 0 comments
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented
Milestone

Comments

@kippr
Copy link

kippr commented Sep 24, 2019

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 [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

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)

  1. Connect hubot to your slack instance
  2. Start the slack client
  3. monitor for 'Received presence change update message [..]' in debug logs for your connection/ disconnection events by starting/ quitting client
  4. use tcpkill or some other tool to disrupt hubot's connection to slack; hubot will reconnect
  5. 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.

@seratch seratch added the bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented label Apr 14, 2020
@seratch seratch modified the milestones: 4.8.0, 4.9.0, 4.10.0 Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented
Projects
None yet
Development

No branches or pull requests

2 participants