Yes, I always make sure to call receive
on the collab
module before “releasing the lock”.
I haven’t checked the demo collab code in a while and I’m using sockets in my implementation so the following points might not apply, but these are additional edge cases that I’m handling on the client:
- After confirming steps (regardless of whether the steps originated on the current client or someone else), make sure to send new locally pending steps if there are any. Otherwise it is possible for the last few steps to not get synced in case the user stopped typing while new steps were being received/transmitted (and no one else is typing anymore).
- If we get a “new version” message while there is an already open
getSteps
request, schedule anothergetSteps
request for when the current request finishes. Otherwise it is possible that we do not sync the latest few steps from other clients (if no one is typing anymore).
We haven’t run into syncing issues for quite some time now, so I’m confident that it is fairly robust by now.