Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for late addition of listeners before reaping doc
In the case where 2 clients are connected to a document, the first makes changes while the second is disconnected, then disconnects itself. When the second client connects it will immediately go into the catchup phase which does not immediately add a listener to the document - it only starts listening after the catchup is complete. This can result in a bit of a race condition where the initial check for listeners will return zero and incorrectly reap the document by the time the second client has completeted it's catchup. This avoids reaping the document from underneath clients that are catching up by adding an additional check immediately before reaping the document.
- Loading branch information