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

Infinity error when app disabled #76

Closed
SlayerShadow opened this issue Jun 1, 2016 · 4 comments
Closed

Infinity error when app disabled #76

SlayerShadow opened this issue Jun 1, 2016 · 4 comments

Comments

@SlayerShadow
Copy link
Contributor

When any team disables/removes application after releasing a bot, it produces Slack::Web::Api::Error with account_inactive message on logs. After that, server tries to reconnect, which produces the same error, and it is endless.
I found at /lib/slack-ruby-bot/server.rb:94 potential problem which in fact infinitely restart server without the checking of incoming error type.

@dblock
Copy link
Collaborator

dblock commented Jun 1, 2016

Indeed, this is a bug (or non-feature).

In slack-bot-server I patched restart to go through https://github.com/dblock/slack-bot-server/blob/aed0283a97aaf4c6e9a331099c678288708860ae/slack-bot-server/service.rb#L43 which would disable the service.

I'd like something here that addresses this problem and maybe invokes a callback like "disabled".

@SlayerShadow
Copy link
Contributor Author

Thanks! I tried to change this current restart method, and it works.
In your example, why did not you include condition to restart! method? I mean, @async ? start_async : start! is conveniently for testing. I use start_async for development mode and start! command for production, and it could be unexpected behaviour in case of error if bot will be restarted with async mode on production.

@dblock
Copy link
Collaborator

dblock commented Jun 2, 2016

I think that would be a sensible change @SlayerShadow, feel free to PR.

@SlayerShadow
Copy link
Contributor Author

Thanks. This is my first pull request, so sorry if something went wrong. :)

@dblock dblock closed this as completed in 1000343 Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants