[PRO]: Bug: Data Loss on Page Reload with Schema Enforcing Heading as First Block on Reload in Collaborative Setup #5032
Labels
Category: Pro
The issue or pull request is related to the pro packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Which packages did you experience the bug in?
@tiptap/extension-collaboration
What Tiptap version are you using?
2.2.2
What’s the bug you are facing?
We've encountered a critical issue with Tiptap when using a custom extension that extends @tiptap/extension-document with a schema defined to ensure the first block is a title ('title block*'). This setup causes data loss upon page reload in a collaborative editing environment powered by Hocus-Pocus and Yjs for backend data management.
Detailed Explanation:
Our schema is designed to mandate a title block as the first block, followed by an indefinite number of blocks (block*). This configuration is critical for our document structure. However, we've observed that upon page reload, before the editor has a chance to fully load and synchronize the document from the server, the schema enforcement leads to a document state update that erroneously considers the existing content invalid and replaces it with an initial state adhering to the schema. This premature state enforcement and subsequent synchronization with the server result in data loss.
Here is the title node:
Using Collaboration from '@tiptap/extension-collaboration'
The reload issue is resolved by changing Document content to
block*
What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
Reloading page mustn't delete the data when first block is enforced to title block while in collaboration environment.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: