Operational-Transformation / ot.js

MIT License
2.06k stars 216 forks source link

Both operations have to have the same base length #37

Open LaKing opened 6 years ago

LaKing commented 6 years ago

Not sure if my code uses ot correctly, as I could not compare it with the documentation ... but it works .. until suddenly the text gets duplicated multiple times on one client.

Error: Both operations have to have the same base length
    at ot.TextOperation.TextOperation.transform (/srv/codepad-project/modules/ot/node_modules/ot/lib/text-operation.js:411:13)
    at ot.WrappedOperation.WrappedOperation.transform (/srv/codepad-project/modules/ot/node_modules/ot/lib/wrapped-operation.js:66:16)
    at EditorSocketIOServer.ot.Server.Server.receiveOperation (/srv/codepad-project/modules/ot/node_modules/ot/lib/server.js:27:19)
    at EditorSocketIOServer.onOperation (/srv/codepad-project/modules/ot/editor-socketio-server.js:91:37)
    at /srv/codepad-project/modules/ot/editor-socketio-server.js:53:26
    at EditorSocketIOServer.mayWrite (/srv/codepad-project/modules/ot/editor-socketio-server.js:23:13)
    at Socket.<anonymous> (/srv/codepad-project/modules/ot/editor-socketio-server.js:48:22)
    at emitThree (events.js:136:13)
    at Socket.emit (events.js:217:7)
    at /srv/codepad-project/boilerplate/modules/server/node_modules/socket.io/lib/socket.js:527:12
LaKing commented 6 years ago

This seems to happen if two clients are connected, and then the connection drops ....

aminbaig commented 5 years ago

Any update on this...? I have been having the same issue.

LaKing commented 5 years ago

Not sure how I got it fixed, .. sorry I don't remember.

You get this error if you use ot somehow wrong, with wrong parameters or so ...