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

Fix editor desyncing #39

Closed msujew closed 1 month ago

msujew commented 1 month ago

Closes https://github.com/TypeFox/open-collaboration-tools/issues/37

There were two main culprits:

  1. We used an incorrect, non-async mutex. This usually wasn't an issue on local networks due to low latency, but it leads to issues in production.
  2. Ignore local Yjs events; After fixing the mutex situation, the editor continued acting up by adding every keypress twice to the document. This is fixed by simply ignoring all document changes that originate from the local client.