question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Applied attributes can cause apply mismatched. Needs load test coverage to replicate.

See original GitHub issue

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.

  1. Enable loadTesting.
  2. Run loadTesting
  3. 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.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
JohnMcLearcommented, Jul 17, 2020

Noted @yorickreum. But if I can fix this issue it’s probable/possible it will fix your issue. The mismatched apply is essentially a race condition that I need to remedy and this issues bug fix will hopefully cover all eventualities of that race condition happening irrespective of the cause.

0reactions
JohnMcLearcommented, Jul 22, 2020

@Oremountainflorian I’d be tempted to suggest testing without plugins to see if it continues.

Within the 1 minute of the error persisting did you attempt to refresh your browser? Changesets are not stored persistently so it makes no sense that a refresh of low activity did not fix. I feel some plugin fuckery could be afoot

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I increase my code coverage, or why can't I cover ...
Code coverage is a measurement of how many unique lines of your code are executed while the automated tests are running.
Read more >
Troubleshooting Code Coverage - Visual Studio (Windows)
Explanation—Code coverage analysis is done while tests are running. It only includes assemblies that are loaded into memory when the tests run.
Read more >
Test coverage visualization - GitLab Docs
This will allow you to see which lines are covered by tests, and which lines still require coverage, before the MR is merged....
Read more >
Improve Java Code Coverage and Quality with Unit Tests and ...
We're going to use a sample program to explore how code coverage and cyclomatic complexity calculations are useful for making sure that Java ......
Read more >
ETL Testing Tutorial - Guru99
In this ETL/Data Warehouse Testing Tutorial we wil learn What is ETL, ... ETL testing is a concept which can be applied to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found