slack-ruby-bot: Duplicate responses to commands after bot is left idling w/ celluloid

Hi there,

We are using this gem in a simple project that uses a database. We’ve noticed that when we let the app idle for some time (unsure exactly for how long, maybe about an hour) then the bot processes text commands multiple times. The gems slack-ruby-bot and slack-ruby-client are on the latest version.

I have created a minimal setup with which I am able to reproduce this issue: https://github.com/jillguyonnet/slack_ruby_bot_minimal. This is a very simple app that manages a list of items. Note that it was based on https://github.com/slack-ruby/slack-ruby-bot/blob/master/TUTORIAL.md and uses the MVC approach. The available commands are:

  • hi
  • show: print a list of items
  • add: add an item to the list
  • clear: clear the list

Similar to our real project, the issue of multiple command processing happens when I let the app run for a while. Here is a screenshot where the bot responds twice to hi: Screenshot 2019-09-09 at 16 33 58

The steps to reproduce are:

  1. Run the app, check that it works by running some commands.
  2. Let it running for a while (at least an hour but possibly several hours).
  3. Run some commands again. More often than not (but not always), the issue will present itself.

We are currently investigating potential sources for this issue. Without confirmation, we think these might include:

Would you, based on this information, be able to suggest the cause of this issue and the best way to fix it?

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 15 (1 by maintainers)

Commits related to this issue

Most upvoted comments

I would appreciate if someone could get to the bottom of this with celluloid. Good project to dive deep!

We’re happy to report that after a week of testing using async-websocket and CONCURRENCY=async-websocket seems to have fixed the issue for us as well. 🎉