Skip to content

Fix event timestamp injection to check both casing variants#56495

Closed
fkgozali wants to merge 1 commit into
facebook:mainfrom
fkgozali:export-D101522871
Closed

Fix event timestamp injection to check both casing variants#56495
fkgozali wants to merge 1 commit into
facebook:mainfrom
fkgozali:export-D101522871

Conversation

@fkgozali
Copy link
Copy Markdown
Contributor

Summary:
UIManagerBinding::dispatchEvent checks for an existing timeStamp property before injecting one, but only checks the camelCase variant. Native events that use lowercase timestamp (e.g. pointer events) would have a duplicate timeStamp injected with the current time, which then takes precedence in the SyntheticEvent timestamp resolution chain (event.timeStamp || event.timestamp).

This adds a check for both timeStamp and timestamp before auto-injecting, preserving the original native event timestamp when present in either casing.

Root cause: #55878 only checked for timeStamp (camelCase).

Changelog: [General][Fixed] - Fix event timestamp injection overriding native timestamps with lowercase property name

Reviewed By: mdvacca

Differential Revision: D101522871

Summary:
UIManagerBinding::dispatchEvent checks for an existing timeStamp property before injecting one, but only checks the camelCase variant. Native events that use lowercase timestamp (e.g. pointer events) would have a duplicate timeStamp injected with the current time, which then takes precedence in the SyntheticEvent timestamp resolution chain (event.timeStamp || event.timestamp).

This adds a check for both timeStamp and timestamp before auto-injecting, preserving the original native event timestamp when present in either casing.

Root cause: facebook#55878 only checked for timeStamp (camelCase).

Changelog: [General][Fixed] - Fix event timestamp injection overriding native timestamps with lowercase property name

Reviewed By: mdvacca

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

meta-codesync Bot commented Apr 19, 2026

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

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @fkgozali in 68debb2

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 19, 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. 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