You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If Yjs detects that another client is already using the local clientID it will generate a new one. The awareness.clientID is not updated which leads to bugs in code where they are assumed to be the same.
An example is @tiptap/extension-collaboration-cursor which uses yCursorPlugin. In https://github.com/yjs/y-prosemirror/blob/master/src/plugins/cursor-plugin.js#L86C5-L86C54 it checks the yDoc.clientID with the clientId coming from the awareness states. With the above situation, it will incorrectly detect your own awareness changes as coming from another client and you will effectively see the collaboration cursor follow your own cursor.
Steps to reproduce the bug
Steps to reproduce the behavior:
Description
If Yjs detects that another client is already using the local clientID it will generate a new one. The awareness.clientID is not updated which leads to bugs in code where they are assumed to be the same.
An example is
@tiptap/extension-collaboration-cursor
which usesyCursorPlugin
. In https://github.com/yjs/y-prosemirror/blob/master/src/plugins/cursor-plugin.js#L86C5-L86C54 it checks the yDoc.clientID with the clientId coming from the awareness states. With the above situation, it will incorrectly detect your own awareness changes as coming from another client and you will effectively see the collaboration cursor follow your own cursor.Steps to reproduce the bug
Steps to reproduce the behavior:
npx ava tests/provider/onClientIdChanged.ts
t.is(provider2.document.clientID, provider2.awareness.clientID)
Expected behavior
Test should succeed. awareness.clientID and document.clientID are kept in sync.
The text was updated successfully, but these errors were encountered: