-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Major bug] data loss in collaborative scenario #108
Comments
This issue has led to the frequent loss of data when cooperating in the table. |
I think the scenario handled by this line of code may contain cases of lost data. y-prosemirror/src/plugins/sync-plugin.js Line 823 in e3755b1
Suppose that optimizing the logic here will help? Similar to the following code: if (left === 0 && yDelLen === 1 && yDomFragment.firstChild) {
yDomFragment.firstChild.delete(left, yDomFragment.firstChild.length)
} else {
yDomFragment.delete(left, yDelLen)
} |
This is the behaviour as far as I know, if you add more than one paragraph while offline, that new paragraph that no one else has will be visible, but if it's the same paragraph the delete keeps the online user intent. |
The code I provided above may introduce the problem of missing styles (injection: bold, italic), because when deleting the last character of the node, the current The following is the screen recording of the lost style: 720-3.mp4
|
Hi,@flaviouk Thank you for your supplement and reminder. I don't have the energy to explore the problem of the list, but I believe that the loss of data must be the highest priority problem to be solved. At present, I don't think the solution I provided above is elegant enough and straight to the key of the problem. You and other friends are welcome to provide better solutions. |
Hi, @dmonad We also look forward to any suggestions from you. :) |
Thanks for the suggestions. ProseMirror Text nodes are mapped to Y.Text objects. However, when ProseMirror deletes a Text object, we do the same, which results in deleting the Y.Text objects and all future changes that are applied to it. In this simple case, we can simply retain the Y.Text object. I think this might even fix the table and list issue. I implemented a fix which I will release today. |
Describe the bug
Using the demo in y-prosemirror, data is lost in the collaborative scenario.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Keep the newly added characters at one peer instead of losing them all.
Recording screen
480p.mov
Environment Information
The text was updated successfully, but these errors were encountered: