Why is content update not working correctly in the collaboration extension? #2193
Replies: 2 comments
-
Technically, that’s correct, because the Y.js binding replaces the whole content multiple times. The real question here is: What actual problem are you trying to solve? Chances are there is a better way to achieve whatever you try to do. Generally speaking, once you switch to Y.js you should work with the Y.js document and basically ignore the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer. As you might guess, I need to collect this data from the editors and send it to the server to be saved in the database. Could you please tell me how it is better to implement it with Y.js? I understand that it is better to use websockets instead of WebRTC. But still what is the best way to solve this with my current code? I have a reason for this. |
Beta Was this translation helpful? Give feedback.
-
Hello.
For the past few days, I have been trying to figure out one problem.
I have several editors from Tiptap on the page. One editor for the short description of the article, another for the content, and so on. Editors are not in a single Vue component, but are divided into their own. For example, a component for a short description, content, and so on.
Below is an example of a component code for description:
Now I will describe the situation. After deployment, three clients (browsers) visit the page. As you can see in the code above, the default is one line with the text "test". As soon as clients visit the page, after a couple of seconds, the content in the editor automatically turns into this:
All three clients have it.
Then one of the clients refreshes the page and together they see this:
Plus one line.
Then another client refreshes the page and...
Another plus one line.
It is important to point out here that this problem occurs only when the client loads or refreshes the page. If clients start editing content without reloading the page, then everything is fine.
Also, if initially there is no content in the editor, that is, if the editor is initially empty (there is no "content" field in the code above), then everything is fine.
It turns out that the problem is in the presence of the "content" field.
I tried to describe the problem in as much detail as possible. I hope for your help in solving this problem.
Beta Was this translation helpful? Give feedback.
All reactions