Details
-
Bug
-
Resolution: Unresolved
-
Major
-
18.7.0-rc-1
-
None
-
Unknown
-
Description
Problem
When several users edit the same page with the BlockNote editor in realtime, some information from the page content is preserved only by the editor of the user who started the collaboration session. If the content is saved by any other participant (explicit save, or auto-save, which can be done by any participant), this information is lost:
- the parameters of blocks such as paragraphs, headings, lists or tables (e.g. (% class="..." %))
- the resource reference and parameters of links (internal page / attachment links), as well as whether a link is free-standing or has a generated label
- the verbatim flag and the leading / trailing new lines of code blocks (a verbatim block can be saved as a code macro, and leading / trailing new lines can be lost)
The same happens if the user who started the session reloads the editor while the session is still alive.
Steps to reproduce
- Create a page with a link to another wiki page (e.g. [[Label>>Sandbox.WebHome]]), a paragraph with parameters (e.g. (% class="box" %)) and a verbatim block.
- Alice edits the page with BlockNote (in-place or standalone).
- Bob joins the collaboration session, makes a change and saves.
- Look at the page source.
Expected: only Bob's change is saved.
Actual: the paragraph parameters, the link reference / parameters and the verbatim block information are lost or altered.
Cause
When loading the content, XWikiBlockNoteProcessor moves this metadata out of the edited content (because the BlockNote editor doesn't support it) and keeps it in a per-client BlockNoteDocument metadata store keyed by block / link id. This store is not part of the shared Y.Doc. The participants that join the session get the content (with the ids) from the Y.Doc, but their metadata store doesn't have entries for these ids, so the metadata is not restored on save.
Possible fix
This metadata comes from the page source and isn't private, so it can be shared with the other participants through the Y.Doc (e.g. a Y.Map keyed by the same ids, written by the client that seeds the session in the same transaction as the content). The macro output, which is rendered for the current user, must stay out of it (see XWIKI-24374).
This is also needed for re-rendering the macros of each participant, since the content sent to the server for rendering must be complete.
Attachments
Issue Links
- relates to
-
XWIKI-24374 Exclude macro output from BlockNote realtime content synchronization
-
- Closed
-