-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix text lines mutator #2911
Fix text lines mutator #2911
Conversation
note to self: this breaks some pads with TypeError: rep.lines.atIndex(...) is undefined |
Be happy to see this land :) Sounds like it's already fixing things? Can I help by giving you access to beta.etherpad.org ? |
Hi, this is an old PR, but it seems important. Any chance to resume the work? |
I spoke to @webzwo0i he's going to work on this when he can :) so we're waiting on him to review/merge. |
Will submit the documentation from here in a separate PR. The tests I added to easysync_tests in this PR are probably nonsense (the last newline is special). textLinesMutator will crash on some crafted changesets but the way it is used in the timeslider seems to be save and every exception is handled well |
Reopening so that I'm reminded I need to make a new PR with docs.
Coverage test needs to go into #4190 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
662ef59
to
8ea5033
Compare
This pull request introduces 1 alert and fixes 1 when merging 8ea5033 into 4637b2b - view on LGTM.com new alerts:
fixed alerts:
|
8ea5033
to
d324882
Compare
d324882
to
a2bd499
Compare
I rebased onto current |
a2bd499
to
74e096b
Compare
They test if it is possible to delete lines from the array that is mutated by a changeset, and after no line is left insert some characters (with or without new lines).
strings where the first ends in a newline.
array. - add some more test cases
74e096b
to
a8f09ab
Compare
Rebased onto latest |
Closed in favor of #5253 |
This should address #2836 but please do not merge this yet!
As you can see there are some "TODOs" left.
The textLinesMutator gets lines of text and a changeset and applies the latter to the former. It should work for attribution and normal text lines. Sometimes when there are no lines left but the changeset is not finished it will crash.
I am not sure I did this right, but I will try to solve the remaining TODOs. I want to ask if anyone has a good idea how to test this stuff. It is used in the timeslider and on clients before submitting changesets. What I need is working test data:
Does this sound reasonable to you? Any other ideas how to be sure this does not break anything?