SF-3680 Ensure that a verse that is not in a para has a blank segment#3665
Open
pmachapman wants to merge 1 commit intomasterfrom
Open
SF-3680 Ensure that a verse that is not in a para has a blank segment#3665pmachapman wants to merge 1 commit intomasterfrom
pmachapman wants to merge 1 commit intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3665 +/- ##
=======================================
Coverage 81.95% 81.95%
=======================================
Files 618 618
Lines 38495 38496 +1
Branches 6300 6300
=======================================
+ Hits 31549 31550 +1
- Misses 5972 5985 +13
+ Partials 974 961 -13 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where a
{ blank: true }operation is not created for a verse that is not in a para, where that verse is followed by a blank para, resulting in operations subsequent ops being incorrectly offset by 1 by the TextViewModel, which requires a blank operation to be present for the first verse.Although this bug only manifests in the frontend editor (not in conversion from Delta to USX), I have added tests to ensure that behavior is not broken in future, and fixed this bug in the backend as that was the least complicated and most compatible fix (note that I did not have to change the logic in
ToUsx(), onlyToChapterDeltas()).I've also run this PR with the roundtrip tool, and can confirm that additional blank segments were only added where they should have been (a very small number of projects I had access to locally were affected by this).
This change is