Skip to content

[RUM-10693] [FIX] React Navigation duplicate views#942

Merged
marco-saia-datadog merged 3 commits into
developfrom
sbarrio/fix/react-navigation-duplicate-views
Jul 23, 2025
Merged

[RUM-10693] [FIX] React Navigation duplicate views#942
marco-saia-datadog merged 3 commits into
developfrom
sbarrio/fix/react-navigation-duplicate-views

Conversation

@marco-saia-datadog

Copy link
Copy Markdown
Member

What does this PR do?

  • Fixes duplication of first RUM View when using @datadog/mobile-react-navigation.
  • Adds navigation timeline for internal debugging

Motivation

The first RUM view is always duplicated when tracking views with @datadog/mobile-react-navigation.

Reason

Calling startTrackingViews() creates a RUM View and registers a navigation state listener, which triggers for the same view, leading to two identical RUM views being created.

Before the fix

Two calls to startView() at startup -> RUM View Home is duplicated.

android-before ios-before

After the fix

The initial second call to startView() is dismissed, and the subsequent calls are not affected.

android-after ios-after

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 self-assigned this Jul 21, 2025
@marco-saia-datadog marco-saia-datadog requested a review from a team as a code owner July 21, 2025 08:41

@cdn34dd cdn34dd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@marco-saia-datadog marco-saia-datadog merged commit 349fa15 into develop Jul 23, 2025
10 checks passed
@marco-saia-datadog marco-saia-datadog deleted the sbarrio/fix/react-navigation-duplicate-views branch July 23, 2025 11:37
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.

3 participants