-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Using faye-websocket, receiving multiple copies of same Slack message #285
Comments
I am going to guess that you're spawning these multiple times, possibly through some loop on a disconnect? Save the threads that you're spawning and try to If you want a tested implementation for multiple teams try https://github.com/slack-ruby/slack-ruby-bot-server? |
@dblock Thank you for the rapid response. After further debugging it appears to be an issue with Some additional info: after extensive manual and automated testing including logging thread IDs and Slack message IDs from multiple app instances using multiple bots, I am quite certain my app logic is maintaining only one thread per team and only one call to |
The ping thread causes a disconnect, properly sends |
We should remove EM support via #338 |
I'm using
where
<team_token>
is an access token for a specific team. I'm then usingOR
to start the client in its own thread. Both produce the same results.
After a period of a few minutes of uptime, the messages being received through
client.on :message
appear multiple times. After a few minutes, I'm receiving upwards of 10 copies of every message. An app restart resets the issue. After a few minutes I see the duplicates building up again.When booting multiple instances of the app with different team tokens hooked into the same Slack channel (2 different bots), it's clear the duplicates are happening on the client side. At one point one of the app instances will be reporting only one copy of each message and the other instance will report multiple copies of the same message.
By adding
Thread.current.object_id
to the debug logging, it's clear the duplicate messages are being received by the same thread. Here are the details of an event that I see multiple times, for example:I will see this multiple times in a row, all with the same exact info. It's as if there are multiple instances of the websocket open for a team when there should be only one...?
See https://github.com/jcraigk/phishin-chatbot/blob/master/app/services/websockets/slack.rb for my current implementation.
The text was updated successfully, but these errors were encountered: