Details
-
Bug
-
Resolution: Unresolved
-
Major
-
18.4.0
-
None
-
Unknown
-
Description
Steps to reproduce, with Chrome 158 or later:
- Edit a page in-place with the BlockNote editor (realtime), alone, change something and save.
- Switch to the wiki editor (e.g. using the edit menu), change the content there, and use Save & View.
- Edit the page in-place with BlockNote again.
Expected: the editor shows the content saved at step 2.
Actual: the editor shows the content from step 1. The changes made at step 2 are lost as soon as the page is saved from BlockNote (e.g. image parameters added in the wiki editor disappear).
Cause
Since Chrome 158, the page edited in-place is kept frozen in the browser's back/forward cache (bfcache) when the user navigates away, instead of being destroyed (see XWIKI-25826 for the same problem with the realtime CKEditor). The collaboration provider removes its awareness state on pagehide, so the other participants don't list it anymore, but its WebSocket connection stays open while the page is frozen. The server keeps the collaboration room, and its update history, as long as a client is connected, so the next BlockNote session joins that room and synchronizes with the content of the previous session instead of loading the saved document.
Verified with a diagnostic functional test, on Chrome 158, at the same commit and with the same artifacts: with the bfcache, pagehide with persisted=true followed by freeze when switching to the wiki editor, and the second BlockNote session shows the content of the first session; with Chrome started with --disable-features=BackForwardCache, persisted=false and the second session shows the saved content. ImageIT#editImage and CollaborationIT#restrictScriptMacroExecution fail in the Chrome configurations of the environment tests since Chrome 158, and pass with the bfcache disabled.
Fix
Disconnect the collaboration provider when the page is stored in the bfcache (pagehide with persisted), and reconnect it, restoring the awareness state, when the page is restored from the bfcache (pageshow with persisted). The synchronization done on reconnect already handles the case where the room was replaced by a new session in the mean time.
Attachments
Issue Links
- is related to
-
XWIKI-25826 Leaving the realtime editor doesn't leave the editing session when the browser keeps the page in its back/forward cache
-
- Open
-
- relates to
-
XWIKI-25834 BlockNote in-place editor is not loaded when editing again after Summarize & Done without reloading the page
-
- Open
-