We've experienced the bot going offline randomly without producing any output, or throwing any exceptions. My best guess as to why this is happening is Slack closing the websocket used for communication on their end after it has been idle for a given period of time.
However since implementing the test for liveness of the websocket I have been unable to reproduce the bug, as there is a constant small amount of activity over the websocket event when the bot is idle.
This pull request implements the following :
Checks for disconnections of the websocket using ping/pong queries as suggested in the Slack documentation every 5s.
Requests a new connection if the websocket is found to be dead.
Provides brief instructions on how to run the container for development.
Added vendor/ to .dockerignore to ensure a clean build of the container.
Some of this functionality seems suited to the underlying libraries, but as they are no longer actively maintained I've put the functionality in the existing subclass SlackRTMClient. My PhP isn't exactly my first language so any comments on how this would more conventionally done would be greatly appreciated!
We've experienced the bot going offline randomly without producing any output, or throwing any exceptions. My best guess as to why this is happening is Slack closing the websocket used for communication on their end after it has been idle for a given period of time.
However since implementing the test for liveness of the websocket I have been unable to reproduce the bug, as there is a constant small amount of activity over the websocket event when the bot is idle.
This pull request implements the following :
vendor/
to.dockerignore
to ensure a clean build of the container.Some of this functionality seems suited to the underlying libraries, but as they are no longer actively maintained I've put the functionality in the existing subclass
SlackRTMClient
. My PhP isn't exactly my first language so any comments on how this would more conventionally done would be greatly appreciated!