Websocket connection drops

Is there a way for the websocket to not disconnect if there are a low number of messages being sent? I wish to only subscribe to the users channel, but it seems like the websocket will disconnect due to inactivity/low amount of messages being sent so I need to also subscribe to the heartbeat channel which is pointless for me. Any suggestions? Thanks in advance!

There’s probably a better way, but I filter heartbeats, letting one heartbeat in every so often (3 min currently). That is, I filter heartbeats in the on_message routine. Seems to help, rarely get disconnected but it does occasionally happen.

Hi @eric20fan you can add an implementation that will automatically reconnect your websocket upon disconnecting. Disconnects are normal with websockets and are sometimes even forced by us when deploying updates. Also, you may consider increasing the timeout window for the library or stack you are using.

2 Likes