slack-ruby-client icon indicating copy to clipboard operation
slack-ruby-client copied to clipboard

client.on :message stops listening to new messages

Open MarioRuiz opened this issue 2 years ago • 2 comments

randomly client.on :message stops listening to RTM No logs even stored after that on the supplied logger but the app shows as connected. No clue what exactly happens, same code has been working for years without issues. any idea how can we identify the reason?

MarioRuiz avatar Jun 23 '23 15:06 MarioRuiz

I would start from isolating whether this is a problem where Slack stops sending messages, whether the websocket gets closed, a blocking thread in the app, or something else. Enable debug logging and look for https://github.com/slack-ruby/slack-ruby-client/blob/bf5bb4be3e03e9bd74d22942a61d5611f5c1d997/lib/slack/real_time/client.rb#L83 or any other messages being hit.

Next, it's probably time to move to events, https://github.com/dblock/slack-ruby-bot-server-events. Slack is likely slowly making it more and more difficult to run realtime clients.

dblock avatar Jun 24 '23 21:06 dblock

@MarioRuiz Did you ever find the root cause of this? Could be code that hangs (and potentially solved with https://github.com/slack-ruby/slack-ruby-client/pull/486)?

dblock avatar Aug 09 '23 18:08 dblock