Steps to reproduce
- Edit a page alone with the realtime wiki editor and type some text, without saving.
- Lose the network connection briefly (e.g. go offline and then back online), so that the editor reconnects.
- Open the same page in edit mode as another user, or in another browser tab.
- Type some more text in the first editor.
Expected result The second user sees the content of the first user (including the unsaved changes) and the two editors stay synchronized. Actual result The second user sees only the saved content and the changes made afterwards in the first editor never reach them. It happens whenever the last change made before the connection loss was already received by the server, which is the common case. Cause When the only user editing a page loses the connection, the server removes the realtime session (the Netflux channel) and the editor joins a new, empty, one when it reconnects. But the realtime wiki editor keeps using its previous ChainPad instance, whose history exists only in the removed channel, so it doesn't send its content to the new channel. Users joining the new channel get an empty history and they ignore the next changes of the first user, because they don't know the changes these are based on. Notes
- Detected by RealtimeWikiEditorIT#toggleRealtimeWithSelf, which has been failing regularly on CI since the reconnect step was added to it for
XWIKI-25236.
- The realtime WYSIWYG editor already starts a new realtime session in this case, but its initial content includes the unsaved changes, so a user who joins before the first user makes another change sees only the saved content. That is a separate, less severe, problem.
|