plate icon indicating copy to clipboard operation
plate copied to clipboard

Collaboration demo do not sync comment data

Open Laxy317 opened this issue 1 month ago • 1 comments

Description

The collaborative editing demo code can sync code changes, but it seems unable to sync comments

Video

https://github.com/user-attachments/assets/85161a7d-e0e2-4fea-846e-185502143d4d

Reproduction URL

No response

Reproduction steps

> I tried using the Collaboration demo on the official website for the presentation, but there seems to be an issue. The editor did not initialize successfully (the text value after initialization is not displayed), and I cannot focus on the editor. So I directly copied the code to run locally. I suspect the bug can be reproduced on the official website by following steps

1. Open two Collaboration demo pages.
2. Edit any line of text randomly.
3. Add a comment to this line of text.

Plate version

49.0.0

Slate React version

1.0.2

Screenshots


Logs


Browsers

No response

Laxy317 avatar Nov 20 '25 10:11 Laxy317

Comment data does not sync in the Collaboration demo because only the document content and cursors are synced by default with Yjs. The commentPlugin and discussionPlugin manage comments and discussions locally—they are not integrated with Yjs or any collaborative provider out of the box, so comment state and discussion threads do not sync between clients in collaborative sessions docs discussionPlugin code.

To enable collaborative comment syncing, you would need to explicitly bridge comment/discussion state to Yjs or another provider. Currently, there’s no built-in support or example for this in Plate v49.0.0 collaboration demo docs. Comments added via the commentPlugin are only visible on the local editor instance unless you implement your own syncing logic.

For the editor initialization issue (empty/unresponsive editor), set skipInitialization: true in your Plate editor config and call editor.getApi(YjsPlugin).yjs.init after the editor is mounted and Yjs has synced issue thread. This avoids double-initialization and ensures the editor loads the shared document content correctly.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Nov 20 '25 10:11 dosubot[bot]