Hey ShareDB's team!
While using https://github.com/ottypes/json1 with ShareDB, I found a small problem in Doc.prototype._rollback. It automatically uses JSON1.type.invert but since we don't use invertible operations (our remove ops do not contain the removed data), it does not work.
|
if ('op' in op && op.type.invert) { |
|
op.op = op.type.invert(op.op); |
|
|
|
// Transform the undo operation by any pending ops. |
|
for (var i = 0; i < this.pendingOps.length; i++) { |
|
var transformErr = transformX(this.pendingOps[i], op); |
|
if (transformErr) return this._hardRollback(transformErr); |
|
} |
Moreover JSON1 support for invertible operations and composition is known to not be without flaws.
Do you think we could introduce a configuration option to deactivate this functionality?
Hey ShareDB's team!
While using https://github.com/ottypes/json1 with ShareDB, I found a small problem in
Doc.prototype._rollback. It automatically usesJSON1.type.invertbut since we don't use invertible operations (our remove ops do not contain the removed data), it does not work.sharedb/lib/client/doc.js
Lines 950 to 957 in fa9179d
Moreover JSON1 support for invertible operations and composition is known to not be without flaws.
Do you think we could introduce a configuration option to deactivate this functionality?