Skip to content

Fix parentTagForUpdate in unflatten-unflatten branch#56542

Closed
fkgozali wants to merge 1 commit into
react:mainfrom
fkgozali:export-D101508791
Closed

Fix parentTagForUpdate in unflatten-unflatten branch#56542
fkgozali wants to merge 1 commit into
react:mainfrom
fkgozali:export-D101508791

Conversation

@fkgozali

Copy link
Copy Markdown
Contributor

Summary:
Fix incorrect parentTag passed as parentTagForUpdate in the unflatten-unflatten branch of calculateShadowViewMutationsFlattener. In the unflatten case, parentTag references a node being created in the same batch, but UPDATE mutations are flushed at position 2 while Creates are at position 5. This causes the UPDATE to reference a parent that does not exist yet, triggering an assertion failure in StubViewTree::mutate(): oldStubView->parentTag == mutation.parentTag.

The fix changes parentTag to parentTagForUpdate in the recursive call at line 684, gated behind a new feature flag fixDifferentiatorParentTagForUnflattenCase for safe rollout.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101508791

Summary:
Fix incorrect parentTag passed as parentTagForUpdate in the unflatten-unflatten branch of calculateShadowViewMutationsFlattener. In the unflatten case, parentTag references a node being created in the same batch, but UPDATE mutations are flushed at position 2 while Creates are at position 5. This causes the UPDATE to reference a parent that does not exist yet, triggering an assertion failure in StubViewTree::mutate(): `oldStubView->parentTag == mutation.parentTag`.

The fix changes `parentTag` to `parentTagForUpdate` in the recursive call at line 684, gated behind a new feature flag `fixDifferentiatorParentTagForUnflattenCase` for safe rollout.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D101508791
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 21, 2026
@meta-codesync

meta-codesync Bot commented Apr 21, 2026

Copy link
Copy Markdown

@fkgozali has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101508791.

@meta-codesync

meta-codesync Bot commented Apr 21, 2026

Copy link
Copy Markdown

This pull request has been merged in 5042e58.

@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Apr 21, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @fkgozali in 5042e58

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants