Skip to content
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

Maxdebounce causing client-id to change #845

Open
felixrydberg opened this issue Jul 16, 2024 · 0 comments
Open

Maxdebounce causing client-id to change #845

felixrydberg opened this issue Jul 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@felixrydberg
Copy link

felixrydberg commented Jul 16, 2024

Description
When loading and unloading ydocs within the maxdebounce timeslot yjs changes the client-id.
This will cause the next ydoc unload to fail. This only happens when the client that loads the ydoc has made changes before closing it. Loading and unloading without making changes works fine.

Steps to reproduce the bug

  1. Setup a multiplex environment.
  2. Load a subdoc to your main doc
  3. Make a change to the ydoc shared states (I have used the tiptap editor)
  4. Unload the page and within the maxdebounce time load it again
  5. Unloading should fail with this message:
runtime-core.esm-bundler.js:265  Uncaught TypeError: Cannot read properties of undefined (reading 'clock')
    at encodeAwarenessUpdate (awareness.js:201:78)
    at AwarenessMessage.get (AwarenessMessage.ts:27:25)
    at new MessageSender (MessageSender.ts:13:33)
    at HocuspocusProvider.send (HocuspocusProvider.ts:452:27)
    at HocuspocusProvider.disconnectBroadcastChannel (HocuspocusProvider.ts:580:12)
    at HocuspocusProvider.disconnect (HocuspocusProvider.ts:386:10)
    at HocuspocusProvider.destroy (HocuspocusProvider.ts:515:10)

Expected behavior
Client-id should not be changed.

Screenshot, video, or GIF
If applicable, add screenshots to help explain your problem.

Environment?

  • operating system: Windows 11
  • browser:
  • mobile/desktop: Desktop
  • Hocuspocus version:
    • Server: 2.13.5
    • Provider: 2.13.2

Additional context
There is a workaround for this, just decrease the maxdebounce config

@felixrydberg felixrydberg added the bug Something isn't working label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants