Skip to content

Formalize event timestamps and propagate from host platform to JS#55878

Closed
rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte:export-D94669354
Closed

Formalize event timestamps and propagate from host platform to JS#55878
rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte:export-D94669354

Conversation

@rubennorte
Copy link
Copy Markdown
Contributor

Summary:
Changelog: [General][Fixed] - Fix event timestamp propagation from host platforms to JS

This adds event timestamps as a first class concept in Fabric during dispatch, and uses the new methods to dispatch events to pass the values from the host platform (Android and iOS). If the value isn't pass, the current timestamp at the time of dispatch is used (which is close enough).

This fixes several problems:

  1. Makes event timestamps account for native event dispatch delay.
  2. Normalizes event timestamps across APIs (event timestamp property, Event Timing API information, etc.).

NOTE: I had to implement clock correction on iOS because the timing we get from UITouch objects doesn't use the same clock as we do in C++.

Differential Revision: D94669354

@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 Mar 3, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 3, 2026

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

rubennorte added a commit to rubennorte/react-native that referenced this pull request Mar 4, 2026
…cebook#55878)

Summary:
Pull Request resolved: facebook#55878

Changelog: [General][Fixed] - Fix event timestamp propagation from host platforms to JS

This adds event timestamps as a first class concept in Fabric during dispatch, and uses the new methods to dispatch events to pass the values from the host platform (Android and iOS). If the value isn't pass, the current timestamp at the time of dispatch is used (which is close enough).

This fixes several problems:
1. Makes event timestamps account for native event dispatch delay.
2. Normalizes event timestamps across APIs (event timestamp property, Event Timing API information, etc.).

NOTE: I had to implement clock correction on iOS because the timing we get from UITouch objects doesn't use the same clock as we do in C++.

Reviewed By: javache, NickGerleman

Differential Revision: D94669354
rubennorte added a commit to rubennorte/react-native that referenced this pull request Mar 4, 2026
…cebook#55878)

Summary:
Pull Request resolved: facebook#55878

Changelog: [General][Fixed] - Fix event timestamp propagation from host platforms to JS

This adds event timestamps as a first class concept in Fabric during dispatch, and uses the new methods to dispatch events to pass the values from the host platform (Android and iOS). If the value isn't pass, the current timestamp at the time of dispatch is used (which is close enough).

This fixes several problems:
1. Makes event timestamps account for native event dispatch delay.
2. Normalizes event timestamps across APIs (event timestamp property, Event Timing API information, etc.).

NOTE: I had to implement clock correction on iOS because the timing we get from UITouch objects doesn't use the same clock as we do in C++.

Reviewed By: javache, NickGerleman

Differential Revision: D94669354
…cebook#55878)

Summary:
Pull Request resolved: facebook#55878

Changelog: [General][Fixed] - Fix event timestamp propagation from host platforms to JS

This adds event timestamps as a first class concept in Fabric during dispatch, and uses the new methods to dispatch events to pass the values from the host platform (Android and iOS). If the value isn't pass, the current timestamp at the time of dispatch is used (which is close enough).

This fixes several problems:
1. Makes event timestamps account for native event dispatch delay.
2. Normalizes event timestamps across APIs (event timestamp property, Event Timing API information, etc.).

NOTE: I had to implement clock correction on iOS because the timing we get from UITouch objects doesn't use the same clock as we do in C++.

Reviewed By: javache, NickGerleman

Differential Revision: D94669354
@meta-codesync meta-codesync bot closed this in aa51746 Mar 4, 2026
@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 4, 2026
@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in aa51746

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

@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 4, 2026

This pull request has been merged in aa51746.

zoontek pushed a commit to zoontek/react-native that referenced this pull request Mar 9, 2026
…cebook#55878)

Summary:
Pull Request resolved: facebook#55878

Changelog: [General][Fixed] - Fix event timestamp propagation from host platforms to JS

This adds event timestamps as a first class concept in Fabric during dispatch, and uses the new methods to dispatch events to pass the values from the host platform (Android and iOS). If the value isn't pass, the current timestamp at the time of dispatch is used (which is close enough).

This fixes several problems:
1. Makes event timestamps account for native event dispatch delay.
2. Normalizes event timestamps across APIs (event timestamp property, Event Timing API information, etc.).

NOTE: I had to implement clock correction on iOS because the timing we get from UITouch objects doesn't use the same clock as we do in C++.

Reviewed By: javache, NickGerleman

Differential Revision: D94669354

fbshipit-source-id: 945ce5dd2d2f44f2106e631854de40a109a6cb81
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.

3 participants