Skip to content

Conversation

@marco-saia-datadog
Copy link
Member

What does this PR do?

This PR updates wrapRumAction so that RUM actions are reported before executing the original onClick / onTap callback. The execution order of the wrapped interaction handlers is reversed for actions to be created at the correct time.

Motivation

Previously, the plugin reported RUM actions only after the user-defined callback had finished executing. Since these callbacks can perform arbitrary logic and may introduce delays, the resulting action could be reported with an incorrect timestamp.

One observed consequence of this was tap actions for navigation buttons appearing in the RUM waterfall only after the view they navigate to.

Any delay or side effect inside the callback could cause the interaction to be recorded later than it actually occurred.

Reporting the action before executing the callback grants accurate timing and preserves the correct interaction order across all use cases.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@marco-saia-datadog marco-saia-datadog requested a review from a team as a code owner January 8, 2026 10:06
sbarrio
sbarrio previously approved these changes Jan 9, 2026
Copy link
Contributor

@sbarrio sbarrio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 Nice catch!

@sbarrio sbarrio self-assigned this Jan 9, 2026
@cdn34dd
Copy link
Contributor

cdn34dd commented Jan 13, 2026

Changing the target of this PR to V2 instead, as its a fix that should also be included there.

@cdn34dd cdn34dd changed the title [RUM-13676] [FIX] [V3] Babel: fix RUM Action report order [RUM-13676] [FIX] Babel: fix RUM Action report order Jan 13, 2026
@cdn34dd cdn34dd force-pushed the marcosaia/RUM-13676/fix-rum-action-report-order branch from 553ccfc to 65ed580 Compare January 13, 2026 15:17
@cdn34dd cdn34dd requested a review from a team as a code owner January 13, 2026 15:17
@cdn34dd cdn34dd changed the base branch from feature/v3 to develop January 13, 2026 15:17
@cdn34dd cdn34dd removed the request for review from a team January 13, 2026 15:18
@cdn34dd cdn34dd merged commit 47a1fc7 into develop Jan 13, 2026
9 checks passed
@cdn34dd cdn34dd deleted the marcosaia/RUM-13676/fix-rum-action-report-order branch January 13, 2026 15:35
@cdn34dd cdn34dd mentioned this pull request Jan 15, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants