Skip to content

Wrap push, replace, navigate, back, dismiss in addition to prefetch #6158

Closed

Description

@alwx

wrapExpoRouter() in tracing/expoRouter.ts only wraps prefetch. The ExpoRouter interface already enumerates push, replace, back, navigate, but none of them are instrumented. As a result, programmatic navigations are invisible at the call-site level — we only see the resulting state change via the React Navigation listener, with no link back to the code that triggered it.

Wrap the other router methods so each navigation call:

  • Adds a breadcrumb (category: 'navigation', type: 'navigation') carrying the method (push / replace / navigate / back / dismiss), the target href, and the parsed pathname/params.
  • Associates the call with the subsequent idle navigation transaction so the span can be attributed to the initiating method (e.g. navigation.method = "push").
  • Mirrors the existing prefetch error/status handling (SPAN_STATUS_OK / SPAN_STATUS_ERROR).
  • Is safe to call repeatedly — keep the __sentryPrefetchWrapped guard pattern and extend it to a single __sentryWrapped flag.

Activity

  1. linear-code commented on May 18, 2026

    @linear-code
  2. github-actions commented on Jun 11, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6221, which was included in the 8.14.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions