Skip to content

tree: Fix bug with updating node parentage in sequence composition#27387

Open
alex-pardes wants to merge 3 commits into
microsoft:mainfrom
alex-pardes:compose-bugfix
Open

tree: Fix bug with updating node parentage in sequence composition#27387
alex-pardes wants to merge 3 commits into
microsoft:mainfrom
alex-pardes:compose-bugfix

Conversation

@alex-pardes
Copy link
Copy Markdown
Contributor

Description

Fixed a bug where sequence field failed to call onMoveIn in some cases when moving a node changeset during composition. This would lead to the composed changeset having incorrect node ancestry information, which could cause problems during other operations.

Copilot AI review requested due to automatic review settings May 26, 2026 18:06
@alex-pardes alex-pardes requested a review from a team as a code owner May 26, 2026 18:06
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (7 lines, 2 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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes sequence-field composition so that when composing move-related node changes (modifyAfter), the cross-field manager is notified via onMoveIn, preventing incorrect node ancestry/parentage in the composed changeset.

Changes:

  • Removes onMoveIn invocation from ComposeQueue.dequeueBase.
  • Invokes moveEffects.onMoveIn(...) when modifyAfter is retrieved in getModifyAfter, ensuring it also runs in cases like dequeueBoth.

Comment thread packages/dds/tree/src/feature-libraries/sequence-field/compose.ts
Comment on lines 666 to 668
if (effect.value?.modifyAfter !== undefined) {
moveEffects.onMoveIn(effect.value.modifyAfter);
return effect.value.modifyAfter;
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