Skip to content

Prevent stale mounting revisions from recreating removed views - #59468

Open
DorianMazur wants to merge 1 commit into
react:mainfrom
DorianMazur:chore/reject-stale-mounting-revisions
Open

DorianMazur wants to merge 1 commit into
react:mainfrom
DorianMazur:chore/reject-stale-mounting-revisions

Conversation

@DorianMazur

@DorianMazur DorianMazur commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

A delayed revision can reach MountingCoordinator::push after a newer revision has already been pulled. Since pulling clears lastRevision_, the older revision is accepted and the next transaction can recreate a removed view.

Reject revisions older than baseRevision_ under the existing mutex. Equal revisions retain their existing behavior.

Changelog:

[ANDROID] [FIXED] - Prevent stale mounting revisions from recreating removed views during concurrent commits.

Test Plan:

Run the two added cases in MountingCoordinatorTest.cpp with a native C++ test harness:

  • lateRevisionDoesNotRecreateRemovedView: after revision 3 removes a view, a delayed revision 2 must produce no transaction or change to the base; revision 4 must still be accepted.
  • lateRevisionPreservesNewerPendingRevision: an older push must not replace a newer pending revision.

Locally ran ./mounting_coordinator_tests --gtest_filter='MountingCoordinatorTest.*': both pass with the fix. Without the guard, the first regression fails.

The executable was built with a temporary local CMake/gtest harness, which is not included in this PR; this is not a repository-provided test command. Execution of these tests in upstream CI has not been verified.

@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 Oct 25, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Oct 25, 2026

This branch has not been deployed

No deployments
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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant