WebSocket gets disconnected
Has anyone been using this library to make bots or clients that rely on the WebSocket connection staying connected? Mine seems to get disconnected after awhile but without any errors I can spot...
@Jaykul , have you had any luck with this? It could just be sporadic connectivity issues on either end of the connection.
I've had this issue with other libraries - I think it's a case of the websocket being closed from Slack's end rather than an error in the library. The solution in the nodejs library I used was to detect when the connection dropped and retry it, up to a maximum number of retries. Might be something that's needed here too? I've only just started using this library but I will take a quick look and see if I can figure out where this should go.
same problem here, websocket is closed after awhile without any exceptions.
I think I have traced this down to a bug detailed in this article: https://stackoverflow.com/questions/40502921/net-websockets-forcibly-closed-despite-keep-alive-and-activity-on-the-connectio
For this to be the cause you will see a disconnect after about 100 seconds. If this is not the case you just need to create a timer to manage a ping /pong exchange and reconnect if unsuccessful.
There is a workaround but there will need to be a more permanent fix.
Best regards
Ian