Bug description:
When adding an Assign node followed by a Dynamic Choice node, then performing undo three times (where the first undo shifts the entire stack), adding a new Dynamic Choice and undoing again causes the Dynamic Choice node to be substituted with an Assign node.
Expected behavior:
Undo/redo should restore the correct node types and state. A Dynamic Choice node must remain a Dynamic Choice after undo, without being replaced by an Assign node.
Screenshots:
on first undo:

second undo:

third undo (after adding Dynamic Choice):
Additional information:
Repro steps:
- Add Assign
- Add Dynamic Choice
- Undo twice
- on first undo, the whole stack shifts
- second undo
- Add Dynamic Choice
- Third Undo
Result:
- Second undo shifts stack
- Dynamic Choice is replaced by Assign
Bug description:
When adding an Assign node followed by a Dynamic Choice node, then performing undo three times (where the first undo shifts the entire stack), adding a new Dynamic Choice and undoing again causes the Dynamic Choice node to be substituted with an Assign node.
Expected behavior:
Undo/redo should restore the correct node types and state. A Dynamic Choice node must remain a Dynamic Choice after undo, without being replaced by an Assign node.
Screenshots:

on first undo:
second undo:

third undo (after adding Dynamic Choice):
Additional information:
Repro steps:
Result: