This initial comment seems irrelevant.
This is a bit of an edge case but it can happen. It only happens on very active pads (think 10s of edits a second).
To replicate.
- Enable
loadTesting.
- Run loadTesting
- Copy / paste the padId into the browser.
What happens
Pad wont load
What should hapen
Pad should load.
More debug info
Pad will successfully load and can be edited once Load Testing is complete
If you are already on the pad no errors come and it works great.
Error is
Error: Failed assertion: mismatched apply: 10984 / 11740
Assumption
My assumption is that between the time of us delivering the pad object including the baseRev # there has been an additional change meaning that the next change fails causing mismatched apply.
Consider this scenario..
Rev # |
1 | <-- we connect here
2 | <-- has been an edit here.
3 | <-- is the first commit we receive from the server
The logic is this:
exports.applyToText = function (cs, str) {
var unpacked = exports.unpack(cs);
exports.assert(str.length == unpacked.oldLen, "mismatched apply: ", str.length, " / ", unpacked.oldLen);
I think the solution is Etherpad can "request" previous revision upon receiving a revision that's "in the future" and apply that before the latest revision. Essentially upon receiving 3 and knowing it's at 1 it also requests [2] and applies [2] before 3 ?
I tried to create this same problem on the etherpad-cli-client with etherpad-load-test and can't. The messages always appear to load in order. Next step is to simulate a delay between CLIENT_VARS and NEW_CHANGES and see what happens.
This initial comment seems irrelevant.
This is a bit of an edge case but it can happen. It only happens on very active pads (think 10s of edits a second).
To replicate.
loadTesting.What happens
Pad wont load
What should hapen
Pad should load.
More debug info
Pad will successfully load and can be edited once Load Testing is complete
If you are already on the pad no errors come and it works great.
Error is
Assumption
My assumption is that between the time of us delivering the
padobject including the baseRev # there has been an additional change meaning that the next change fails causing mismatched apply.Consider this scenario..
The logic is this:
I think the solution is Etherpad can "request" previous revision upon receiving a revision that's "in the future" and apply that before the latest revision. Essentially upon receiving
3and knowing it's at1it also requests[2]and applies[2]before3?I tried to create this same problem on the
etherpad-cli-clientwithetherpad-load-testand can't. The messages always appear to load in order. Next step is to simulate a delay betweenCLIENT_VARSandNEW_CHANGESand see what happens.