Skip to content

Fix bug when dispatching unique and non-unique events of the same type on the same target - #50988

Closed
rubennorte wants to merge 4 commits into
react:mainfrom
rubennorte:export-D73849222
Closed

rubennorte wants to merge 4 commits into
react:mainfrom
rubennorte:export-D73849222

Conversation

@rubennorte

Copy link
Copy Markdown
Member

Summary:
Changelog: [internal]

This fixes a potential bug where we coalesce unique events with non-unique ones of the same type and target.

Not marked as a bug fix in the changelog because this wouldn't happen in practice, as we always dispatch events of a given type the same way (all unique or all non-unique).

Differential Revision: D73849222

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Apr 29, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D73849222

Summary:

Changelog: [internal]

This just exposes some enum values and methods that we forgot to expose in a few interfaces.

Reviewed By: javache

Differential Revision: D73849221
Summary:
Changelog: [internal]

Just adding a test suite to verify the behavior of event dispatching in Fabric (especially around event priorities, automatic determination based on ContinuousStart/ContinuousEnd and unique events).

This also surfaced a bug where we incorrectly batch unique and non-unique events together (see the disabled test).

Differential Revision: D73849218
…0987)

Summary:

Changelog: [internal]

This adds a new `isUnique` option in `RawEvent` to determine if it's unique (whether it should be coalesced with other unique events of the same type and target).

This effectively makes `dispatchUniqueEvent` redundant, as we can use `dispatchEvent` with a `RawEvent` marked as unique.

This will allow us to fix the bug we found in the new tests for event dispatching, where non-unique events of a given type where being coalesced with non-unique events of the same type.

Differential Revision: D73849220
…e on the same target (#50988)

Summary:

Changelog: [internal]

This fixes a potential bug where we coalesce unique events with non-unique ones of the same type and target.

Not marked as a bug fix in the changelog because this wouldn't happen in practice, as we always dispatch events of a given type the same way (all unique or all non-unique).

Differential Revision: D73849222
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D73849222

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Apr 29, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in 030ca3c.

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. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants