-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Text/Cursor desynchronized when typing at the same time. #2
Comments
try to remove this code: Lines 150 to 156 in e17d9bc
I've observed the same issue with yjs in another context. Not sure that it is related to Moanco integration. |
I wonder about this line: Line 165 in e17d9bc
@dmonad Could you clarify please why it is important to reorder them fro yjs? 🙏 |
Hi @akosyakov Monaco used to have a very confusing representation of changes. Starting with the doc Nowadays, Monaco already sorts the operations and my sort implementation won't have any effect. I might be wrong about this. But this is how I understood monaco changes. I fixed the cursor issue. Thanks for notifying me. I only test that the documents synchronize. The most recent yjs release has a breaking change that breaks cursor synchronization in monaco and prosemirror. But I can't reproduce any syncing issues. I opened your app and I also tried locally. Please open a separate ticket with a description on how to reproduce it. If you don't know how to exactly reproduce it, please try to make a recording of the issue. I already have several automatic tests for the monaco binding. There is probably an edge case (on the event object?) I'm not considering. |
I published the fix in y-monaco@0.1.0 |
There still seems to be issues, If both collaborators start with a blank state(not on different lines), editor selects whole blocks of text. Will try to make a test-case for it. |
@dmonad Monaco expects to apply a consequent change to a document resulted from an application of a previous change. Do I understand correctly that Yjs expects to apply all changes to the original content? I'm not sure reordering monaco changes like that is safe. (Although it should be probably alright if all changes are happening from typing, not from programmatic edits) If one does not use transact then changes are applied in the same manner as by Monaco but each change result in an update event? |
Reordering is still necessary in Monaco pre version 17. I implemented multiple teats that confirm that Monaco also orders changes by position. So the current approach should still work. I will stop reordering only if it causes bugs to keep supporting older versions. Changes within a Yjs transaction only produce a single event. Otherwise there is no difference whether you use a transaction or several smaller updates. |
Ignore this. I noticed |
Describe the bug
Behavior 1: When two users are typing at the same time. The cursor that is farthest down the page moves up with every key press.
Behavior 2: When two users are typing at the same time. The text gets out of sync. (i.e. one user has many lines of line breaks, the other does not)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Behavior 1 and 2 do not happen. I expect one person type to not affect another persons cursor
Environment Information
Additional context
Im willing to assist in reproducing the issue. It might be difficult to do alone. Let me know so we can coordinate a time.
The text was updated successfully, but these errors were encountered: