ueberdosis / hocuspocus

The CRDT Yjs WebSocket backend for conflict-free real-time collaboration in your app.
https://tiptap.dev/docs/hocuspocus/introduction
MIT License
1.31k stars 126 forks source link

Documents loaded via direct connection not unloaded on disconnect #709

Closed aonnikov closed 1 year ago

aonnikov commented 1 year ago

Description After direct connection to a document is disconnected, the document is not unloaded and stays in memory.

Steps to reproduce the bug Steps to reproduce the behavior:

  1. Open direct connection to a document
  2. Close direct connection
  3. Check Hocuspocus state
  4. The document is no unloaded

UPD: I tried to force unload document when direct connection is closed, but it leads to a problem when the document is uploaded without persisting the latest change.

Expected behavior It is expected that direct connections behave the same way as remote connection, after disconnect the document should be unloaded if there are no other connections.

Environment?