Websocket is automatically reconnected event when intentionally closed
AdamGrzybkowski opened this issue · 2 comments
AdamGrzybkowski commented
The last PR introduced a bug where the lib tries to reconnect even when the websocket is closed intentionally by calling disconnect()
This is what is happening:
disconnect()
is calledonConnectionClosed()
is invokedreconnectTimer
is scheduledreconnectTimer
connects to WebSocket again
I think we should somehow distinguish disconnect()
called be the user and by the library itself. This would give us an option to know wether we should still want to try to reconnect or not.
@dsrees Could you look at this?
dsrees commented
🤦♂️🤦♂️ yeah I'll get that fixed up today