Fall back to doing a _hardRollback when op.type.invert fails#520
Merged
alecgibson merged 1 commit intoshare:masterfrom Oct 5, 2021
Merged
Fall back to doing a _hardRollback when op.type.invert fails#520alecgibson merged 1 commit intoshare:masterfrom
op.type.invert fails#520alecgibson merged 1 commit intoshare:masterfrom
Conversation
This was referenced Oct 5, 2021
Collaborator
|
I think wrapping this in a try/catch is sensible, but I also think this is a bug in Edit: on reflection, I'm not sure |
alecgibson
approved these changes
Oct 5, 2021
Collaborator
alecgibson
left a comment
There was a problem hiding this comment.
Nice one! Thanks for this.
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.
Motivation
When we had rollbacks due to conflicts on our server, the rollback would fail when the rejected ops were
rich-textops, which aren't invertible due to the error in #442.This fix is a less breaking change than what's proposed in #442, #443, and #451, and can potentially close those issues. Unlike those changes, this change:
Closes #442.
Fix
When the ops fail to invert, just fall back to a hard rollback (refetching the data from the server)
Testing
Added automated test for this case that failed before, but passes now.