umap
umap copied to clipboard
feat(sync): Reconnect the websocket on failures.
(I didn't manage to capture it, but you can see when the next try will happen on hover)
When the websocket is disconnected, try to redo an authentication roundtrip. This commit does the following changes:
- Change the way the SyncEngine is instanciated, passing it a server object and the URLs.
- Add a ping/pong mechanism. This is required because otherwise we have no certainty that the connection is still alive.
- Offer a "reconnect" mechanism, increasing the wait time a bit more each time.
- Trigger the reconnect on disconnections and on failure to connect to the websocket (after a specified time)
- When disconnected the "number of connected peers" now indicates "Disconnected".
- Display a dialog to the users saying that they are disconnected.