Fixed WebRTC-YJS synchronisation poisoning
I seem to have fixed the initial sync problems (I was able to reproduce the issue consistently and then fixed that - as long as there is no further very infrequent edge case, it should now work). The setup is a fully connected mesh of 8 or more peers. On reloading the page of one of those peers very quickly, the peer was able to only partially sync with some of them. The problem was that DB transactions in yjs in the peers could call their callbacks with the intent to send a message to the by then already (again) disconnected reloading peer. The send()
function was still called and, therefore, threw and error, which crashed the DB transaction etc. After this, the peer could still receive drawing updates but not synchronise again (ever). This meant that by reloading quickly, you could "poison" about half of the peers on the mesh.
@ztw17 @alh1717 @mnr17 Please have a short look (the actual fix isn't that much code - the time to find the bug was one day)