Skip to content
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

OT: incorrectly set context.forceWeakRemove for MergeDelta #4132

Closed
scofalik opened this issue Jul 31, 2017 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1054
Closed
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@scofalik
Copy link
Contributor

This is how context.forceWeakRemove is set now:

context.forceWeakRemove = !( originalB instanceof RemoveDelta && !history.isUndoneDelta( originalB ) );

This means that it is true whenever originalB is not RemoveDelta. This is wrong. Not only RemoveDelta has RemoveOperation. This causes a bug when transforming MergeDelta, described here: https://github.com/ckeditor/ckeditor5-undo/issues/65#issuecomment-313444977

Actually, since context.forceWeakRemove is used only for RemoveOperation x MoveOperation transformation, we can safely get rid of first part of this condition: originalB instanceof RemoveDelta. The flag doesn't have to have meaningful value if given delta has no RemoveOperations.

@scofalik scofalik self-assigned this Jul 31, 2017
@scofalik scofalik changed the title OT: incorrectly set context.forceWeakRemove for MergeDelta. OT: incorrectly set context.forceWeakRemove for MergeDelta. Jul 31, 2017
@scofalik scofalik changed the title OT: incorrectly set context.forceWeakRemove for MergeDelta. OT: incorrectly set context.forceWeakRemove for MergeDelta Jul 31, 2017
Reinmar referenced this issue in ckeditor/ckeditor5-engine Aug 9, 2017
Fixed: Fixed a bug when additional list item has been created when undoing applying block quote to a list followed by splitting list item in that list. Closes #1053.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 11 milestone Oct 9, 2019
@mlewand mlewand added module:model type:bug This issue reports a buggy (incorrect) behavior. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants