Description
Steps to reproduce
- Open the same page with the BlockNote editor in two browsers, so that they join the same realtime editing session.
- In the first browser, lose the connection (e.g. go offline from the browser developer tools).
- Still in the first browser, insert and delete some text.
- Restore the connection.
Expected
The changes made while disconnected are synchronized with the second browser (and with the users that join the session later) once the first browser reconnects.
Actual
The changes made while disconnected are never sent. The two editors show different content, and the changes the first user makes afterwards may not show up in the second editor either, because they depend on the content that was never sent.
The same happens with the changes made right before the connection loss is detected (up to 30 seconds), which are sent into a connection that is already lost.
Cause
On (re)connect, the Yjs WebSocket provider sends only a sync step 1 and relies on the server to send its own sync step 1, asking for the updates it misses. The XWiki Yjs WebSocket endpoint doesn't hold a Yjs document, only the updates it received, so it replays them but never asks for the missing ones.
Room replaced while disconnected
If all the other users leave while a user is disconnected, the room is discarded. If someone then starts a new session from the saved page, the reconnecting user's document doesn't share any history with the new session: merging them would duplicate the whole content. In this case the editor should stop synchronizing, keep the local changes and tell the user, instead of corrupting the content.
Attachments
Issue Links
- relates to
-
XWIKI-24158 Enable realtime editing for BlockNote editor
-
- Closed
-