Skip to content

tree: Fix bug with node existence revert constraint#27492

Open
alex-pardes wants to merge 4 commits into
microsoft:mainfrom
alex-pardes:revert-constraint-fix
Open

tree: Fix bug with node existence revert constraint#27492
alex-pardes wants to merge 4 commits into
microsoft:mainfrom
alex-pardes:revert-constraint-fix

Conversation

@alex-pardes

Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings June 5, 2026 01:33
@alex-pardes alex-pardes requested a review from a team as a code owner June 5, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Comment thread packages/dds/tree/src/test/shared-tree/editing.spec.ts Outdated
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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that can be a separate PR.

@jason-ha jason-ha self-requested a review June 5, 2026 23:22
alex-pardes and others added 2 commits June 9, 2026 08:38
Co-authored-by: yann-achard-MS <97201204+yann-achard-MS@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants