-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
controls_if: Mutation actions do not undo correctly #2037
Comments
Comparable behavior appears to work correctly with That said, something is bothering me. How is the undo/redo event stream not capturing the necessary changes when capturing the before and after |
This issue exists in again in This issue was originally fixed in #2167 by introducing the method Using |
The root cause of this issue appears to be the same as issue #8225: In the reproduction steps given above, at the point the else clause block is added to the stack in the mutator flyout, the following events are fired (in the given order) (edited for readability): BlockMove {
blockId: "%RcdpdplAuHZK~LiL}9+",
newCoordinate: undefined,
newInputName: "DO1",
newParentId: "RM=6@108I~w2-=F!NzF[",
oldCoordinate: undefined,
oldInputName: "DO1",
oldParentId: "RM=6@108I~w2-=F!NzF[",
recordUndo: true,
}
BlockMove {
blockId: "%RcdpdplAuHZK~LiL}9+",
newCoordinate: undefined,
newInputName: "DO1",
newParentId: "RM=6@108I~w2-=F!NzF[",
oldCoordinate: Coordinate {x: 200.29159545898438, y: 189.7638931274414},
oldInputName: undefined,
oldParentId: undefined,
recordUndo: true,
}
BlockChange {
blockId: "RM=6@108I~w2-=F!NzF[",
element: "mutation",
name: null,
newValue: "{\"elseIfCount\":1,\"hasElse\":true}",
oldValue: "{\"elseIfCount\":1}",
recordUndo: true,
} There is one small wrinkle: unlike the similar event queue reported in the root cause analysis for #8225, the first |
In the process of investigating #7950 I have realised that the events listed in my previous comment may be wrong because although they were logged at the time that they were |
This has been adequately patched for the time being by the (new, higher quality) bandaid in #8539, but the underlying root cause remains and is tracked in #1036. |
Problem statement
Undo does not work correctly when
controls_if
mutator edit actions are interleaved with normal actions.Expected Behavior
One undo step should undo to the previous step, maintaining connections unaffected by the edit.
Actual Behavior
A block connected to an if block where an undo reverts a mutation may also disconnect the child, even when the connected input is not (supposed to be) affected by the mutation.
Steps to Reproduce
2. Next, make the following edits: a. Add an "else if" in the mutator. b. Connect the loop block to the newly created second statement connection c. Add an "else" to the end, within the mutator.
The results should look like this:
Note that making what was supposed to be a single step, editing the last connection via the mutator workspace, it has also disconnected the loop block.
The text was updated successfully, but these errors were encountered: