handle unexpected disconnect flow

This commit is contained in:
Kevin Jahns 2019-05-20 14:12:35 +02:00
parent 1eb06079de
commit 2e92786bf0

View File

@ -72,9 +72,11 @@ class WSSharedDoc extends Y.Doc {
const changedClients = added.concat(updated, removed)
if (conn !== null) {
const connControlledIDs = /** @type {Set<number>} */ (this.conns.get(conn))
if (connControlledIDs !== undefined) {
added.forEach(clientID => { connControlledIDs.add(clientID) })
removed.forEach(clientID => { connControlledIDs.delete(clientID) })
}
}
// broadcast awareness update
const encoder = encoding.createEncoder()
encoding.writeVarUint(encoder, messageAwareness)