TypeFox / open-collaboration-tools

Open Collaboration Tools: live-sharing solution for Eclipse Theia, VS Code and other editors and IDEs
https://www.open-collab.tools/
MIT License
81 stars 5 forks source link

Enable reconnection #32

Closed msujew closed 1 month ago

msujew commented 1 month ago

Changes a few things to allow reconnection upon connection loss:

  1. If a user disconnects from the server, they are not immediately removed from the room (unless they send the room/leave notification beforehand). Instead, the peer is kept alive for 30 seconds, during which the user can attempt to reconnect. For this reconnect, they need to use the exact same JWT, as they first used - otherwise they get treated as a new user.
  2. All requests and notifications to that user will be buffered and resubmitted upon reconnection.
  3. If the user loses connection, the client session won't be immediately disposed. Instead, the client will attempt to reconnect. If this happens within 30 seconds, the session will be continued as normal. The user might need to resync to any changes that happened in the meantime. open-collaboration-yjs takes care of this.