Skip to content

Prevent double calls to setMounted when merging a JS revision#56424

Closed
j-piasecki wants to merge 1 commit intofacebook:mainfrom
j-piasecki:export-D100125886
Closed

Prevent double calls to setMounted when merging a JS revision#56424
j-piasecki wants to merge 1 commit intofacebook:mainfrom
j-piasecki:export-D100125886

Conversation

@j-piasecki
Copy link
Copy Markdown
Contributor

Summary:
Changelog: [GENERAL][FIXED] Fixed double setMounted flag calls with fabric branching enabled

This change removes the commit source condition from the call site in ShadowTree::tryCommit and moves the logic into updateMountedFlag itself:

  • Mounted flags are skipped for ReactRevisionMerge commits because they were already set during the React branch commit. Setting them again would double increment the EventEmitter's additive enable counter.
  • Runtime shadow node references updates condition didn't change, only moved to a single variable.
  • When neither operation is needed, the function returns early to avoid an unnecessary tree traversal under the DispatchMutex.

Differential Revision: D100125886

Summary:
Changelog: [GENERAL][FIXED] Fixed double `setMounted` flag calls with fabric branching enabled

This change removes the commit source condition from the call site in `ShadowTree::tryCommit` and moves the logic into updateMountedFlag itself:

- Mounted flags are skipped for ReactRevisionMerge commits because they were already set during the React branch commit. Setting them again would double increment the EventEmitter's additive enable counter.
- Runtime shadow node references updates condition didn't change, only moved to a single variable.
- When neither operation is needed, the function returns early to avoid an unnecessary tree traversal under the DispatchMutex.

Differential Revision: D100125886
@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 13, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Apr 13, 2026

@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100125886.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @j-piasecki in a9a0000

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

@react-native-bot react-native-bot added the Merged This PR has been merged. label Apr 14, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Apr 14, 2026

This pull request has been merged in a9a0000.

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 p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants