etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Fix textLinesMutator when dealing with insertions/deletions at the end of pad

Open webzwo0i opened this issue 4 years ago • 17 comments

Will clean this up tomorrow (fixing eslint etc). This should fix https://github.com/ether/etherpad-lite/issues/5214 https://github.com/ether/etherpad-lite/issues/5213 and replace https://github.com/ether/etherpad-lite/pull/5215 and https://github.com/ether/etherpad-lite/pull/2911

Also adds some comments and additional coverage.

webzwo0i avatar Oct 29 '21 23:10 webzwo0i

As a side note: The commits that fixed https://github.com/ether/etherpad-lite/issues/2802 should be re-evaluated.

webzwo0i avatar Oct 29 '21 23:10 webzwo0i

This should be ready now.

webzwo0i avatar Oct 30 '21 22:10 webzwo0i

Thanks for the input @rhansen! Will clean up.

Regarding putting the test into the same commit as the fix, I thought we also put the test in a separate commit (before all other commits) as stated somewhere in CONTRIBUTING.md. But in this case, as it's fixing multiple bugs in one PR, I'll definitely include them into the correct commit.

webzwo0i avatar Oct 31 '21 08:10 webzwo0i

Rebased onto latest develop.

rhansen avatar Nov 09 '21 09:11 rhansen

Regarding putting the test into the same commit as the fix, I thought we also put the test in a separate commit (before all other commits) as stated somewhere in CONTRIBUTING.md.

It's OK to add an xit() test before the commit that fixes the bug, then change the xit() to it() in the commit that fixes the bug. I generally don't like that approach for a couple of reasons:

  • It disconnects the addition of the new test from the reason the new test was added (as a regression test for a bugfix). This makes it harder for reviewers to determine that the new test is actually a proper regression test for the bugfix.
  • Mocha doesn't attempt xit() tests. Other test frameworks support the concept of "expected to fail" tests that are still run but don't result in overall failure unless they actually pass (in which case the "expected to fail" should be converted to the usual "expected to pass").

rhansen avatar Nov 09 '21 09:11 rhansen

@webzwo0i I rebased onto latest develop and made some changes to address my feedback. The "easysync tests: move to separate files" commit was split into 5 different commits to make it easier to review. I think the only thing left is to add the regression tests to the commits that fix the associated bugs.

rhansen avatar Nov 14 '21 09:11 rhansen

Thanks! I added the tests to the appropriate commits, ~~added poolOrArray to easysync-assembler~~ and also refined the commit messages of the last three commits.

Rebased onto latest develop

webzwo0i avatar Nov 29 '21 22:11 webzwo0i

OK, I think I ensure that newlines are everywhere first. It's possible that I didn't saw missing newlines because it's dealing with edits at the end of the pad.

webzwo0i avatar Dec 02 '21 01:12 webzwo0i

Any update @webzwo0i?

rhansen avatar Dec 14 '21 06:12 rhansen

Will have time in the next few days. I'll probably tackle curCol/curLine behavior first, including asserting the invariants. For newlines behavior I need to take a look at mutateAttributionLines

webzwo0i avatar Dec 28 '21 19:12 webzwo0i

I rebased onto latest develop and pushed a couple of fixup commits.

rhansen avatar Jan 01 '22 03:01 rhansen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 25 '22 00:04 stale[bot]

Any update on thoses fixup commits ?

LeaChemoul avatar Apr 28 '22 07:04 LeaChemoul

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 27 '22 23:06 stale[bot]

Bump @webzwo0i -- any progress?

JohnMcLear avatar Jun 21 '23 12:06 JohnMcLear

@dependabot rebase

JohnMcLear avatar Jun 21 '23 12:06 JohnMcLear