mirror of https://github.com/status-im/codimd.git
Update to make OT socket io handle error better, use delay to avoid wrong reversion on client
This commit is contained in:
parent
73a8a6c32a
commit
a090008d4a
|
@ -55,7 +55,15 @@ EditorSocketIOServer.prototype.addClient = function (socket) {
|
||||||
if (typeof self.operationCallback === 'function')
|
if (typeof self.operationCallback === 'function')
|
||||||
self.operationCallback(socket, operation);
|
self.operationCallback(socket, operation);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
socket.disconnect(true);
|
setTimeout(function() {
|
||||||
|
var docOut = {
|
||||||
|
str: self.document,
|
||||||
|
revision: self.operations.length,
|
||||||
|
clients: self.users,
|
||||||
|
force: true
|
||||||
|
};
|
||||||
|
socket.emit('doc', LZString.compressToUTF16(JSON.stringify(docOut)));
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue