You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A WebSocket close is not immediate. We should return a Promise, wait for the close event and then resolve. However, the main problem is that we allow to .connect immediately after a .disconnect which results in racy behaviour as both WebSocket connections are bound to the same event handlers.
This would be a major change and requires significant refactoring. For now, applications should always either:
Wait for the connection-closed event, or
Unbind all events after a .disconnect, throw the SaltyRTC instance away and create a new one. Even if you do this, be prepared to see log messages from previous connections (I'm working on removing this).
The text was updated successfully, but these errors were encountered:
lgrahl
changed the title
Disconnecting should be asynchronous
Race conditions when reconnecting
Sep 26, 2018
Main use case is suppressing further log messages from old WebSocket
connections when the application has already discarded it. The main
problem of #108 remains unresolved (race condition).
Main use case is suppressing further log messages from old WebSocket
connections when the application has already discarded it. The main
problem of #108 remains unresolved (race condition).
Main use case is suppressing further log messages from old WebSocket
connections when the application has already discarded it. The main
problem of #108 remains unresolved (race condition).
A WebSocket close is not immediate. We should return a
Promise
, wait for theclose
event and then resolve. However, the main problem is that we allow to.connect
immediately after a.disconnect
which results in racy behaviour as both WebSocket connections are bound to the same event handlers.This would be a major change and requires significant refactoring. For now, applications should always either:
connection-closed
event, or.disconnect
, throw theSaltyRTC
instance away and create a new one. Even if you do this, be prepared to see log messages from previous connections (I'm working on removing this).The text was updated successfully, but these errors were encountered: