Skip to content

Respect Android Fabric event coalescing keys#57074

Open
sorinc03 wants to merge 2 commits into
facebook:mainfrom
sorinc03:fix/android-fabric-event-coalescing-key
Open

Respect Android Fabric event coalescing keys#57074
sorinc03 wants to merge 2 commits into
facebook:mainfrom
sorinc03:fix/android-fabric-event-coalescing-key

Conversation

@sorinc03
Copy link
Copy Markdown
Contributor

@sorinc03 sorinc03 commented Jun 4, 2026

Summary:

Fixes #54635.

Android Fabric receives a customCoalesceKey from Event.dispatchModern, but the key was dropped before the event reached the C++ Fabric queue. This meant coalescable custom native events with the same target/name but different keys could incorrectly replace each other before JS received them.

This change threads the custom coalescing key through the Android Fabric event path and stores it on RawEvent. The C++ event queue now only coalesces unique events when target, event type, and coalescing key all match. Existing callers continue to use the default key 0, so the previous default coalescing behavior is preserved.

Changelog:

[ANDROID] [FIXED] - Respect custom coalescing keys for Fabric events on Android

Test Plan:

./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests com.facebook.react.fabric.SurfaceMountingManagerEventOrderingTest --tests com.facebook.react.fabric.events.FabricEventEmitterTest -Preact.internal.useHermesNightly=false
./gradlew :packages:react-native:ReactAndroid:ktfmtCheck -Preact.internal.useHermesNightly=false
./gradlew ':packages:react-native:ReactAndroid:buildCMakeDebug[arm64-v8a][hermestooling,jsi,etc]' -Preact.internal.useHermesNightly=false
git diff --check

@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 Jun 4, 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 Jun 4, 2026
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.

[Android] Incorrect handling of coalescingKey

1 participant