tree: Fix bug with node existence revert constraint#27492
Conversation
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (94 lines, 3 files), I've queued these reviewers:
How this works
|
| stack.unsubscribe(); | ||
| }); | ||
|
|
||
| it("inverse node existence constraint not violated by unrelated change on moved node", () => { |
There was a problem hiding this comment.
| it("inverse node existence constraint not violated by unrelated change on moved node", () => { | |
| it("inverse node existence constraint on moved node not violated by unrelated change", () => { |
| const handler = getChangeHandler(this.fieldKinds, field.fieldKind); | ||
| for (const [nodeId, inputIndex, outputIndex] of handler.getNestedChanges(field.change)) { | ||
| for (const [nodeId, inputIndex, _outputIndex] of handler.getNestedChanges( | ||
| field.change, |
There was a problem hiding this comment.
Looks like this was the only code path where the output index was used. You could remove it from the getNestedChanges contract (and all computations of it) as part of this PR, or we could do that in a separate PR, I don't mind.
Description
Fixed a bug where if a node existence revert constraint was placed on a node moved in the same transaction, the revert constraint would be violated when rebasing over any change. This PR changes the implementation of the node existence revert constraint to detect violations during invert instead of during rebasing.