Open furkan3ayraktar opened 1 year ago
I have tested this solution and though it fixes the main problem I have noticed that after switching a tab (focusout
event), the cursor of the user (which switches the tab) is blinking for a moment. When we don't register focusout
listener then this problem is solved but I don't know if it introduces other issues or not.
I used pnpm patch to apply this PR and it fixed infinite loops when using awareness with tiptap with y-websocket-server, but the infinite loop still happens with hocuspocus.
If two editors are open for the same Y.Doc, the cursor awareness state enters into an infinite update loop. This commit fixes the issue by using the solution suggested in this issue.
We've been using this solution for the last one and half years in production without any issues. I remembered it when receiving a recent notification from the issue and wanted to share the solution as a PR.