Fall back to doing a _hardRollback when op.type.invert
fails
#520
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-text
ops, 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.