Merge pull request #10505 from overleaf/td-share-js-memory

Remove memory-hogging serverOps from ShareJS document

GitOrigin-RevId: 31840fd775a4babb6db3ae1e45f6f214f0e2564f
This commit is contained in:
Tim Down 2022-11-21 11:19:12 +00:00 committed by Copybot
parent 11e789229e
commit deb6e31e06

View file

@ -928,9 +928,6 @@ define(['ace/ace','crypto-js/sha1'], function (_ignore, CryptoJSSHA1) {
// All ops that are waiting for the server to acknowledge @inflightOp
this.pendingOp = null;
this.pendingCallbacks = [];
// Some recent ops, incase submitOp is called with an old op version number.
this.serverOps = {};
}
// Transform a server op by a client op, and vice versa.
@ -1169,7 +1166,6 @@ define(['ace/ace','crypto-js/sha1'], function (_ignore, CryptoJSSHA1) {
throw new Error('Invalid version from server');
}
this.serverOps[this.version] = oldInflightOp;
this.version++;
this.emit('acknowledge', oldInflightOp);
var _iteratorNormalCompletion13 = true;
@ -1219,11 +1215,7 @@ define(['ace/ace','crypto-js/sha1'], function (_ignore, CryptoJSSHA1) {
// p "if: #{i @inflightOp} pending: #{i @pendingOp} doc '#{@snapshot}' op: #{i msg.op}"
var op = msg.op;
this.serverOps[this.version] = op;
var docOp = op;
var docOp = msg.op;
if (this.inflightOp !== null) {
var _Array$from9 = Array.from(this._xf(this.inflightOp, docOp));