Skip to content

test(tracing): Cover pendingExpoRouterNavigation hand-off in reactNavโ€ฆ

febd51c
Select commit
Loading
Failed to load commit list.
Merged

feat(tracing): Wrap Expo Router push, replace, navigate, back, dismiss in addition to prefetch #6221

test(tracing): Cover pendingExpoRouterNavigation hand-off in reactNavโ€ฆ
febd51c
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: code-review completed Jun 2, 2026 in 6m 6s

1 issue

code-review: Found 1 issue (1 medium)

Medium

Stale `pendingExpoRouterNavigation` can incorrectly tag unrelated React Navigation spans - `packages/core/src/js/tracing/reactnavigation.ts:455-458`

If router.back() or router.dismiss() is called when there is nothing to navigate back to (a silent no-op โ€” no exception, no React Navigation state change), consumePendingExpoRouterNavigation() is never called, so the pending value stays set and will be consumed by the next unrelated navigation, tagging its span with the wrong navigation.method.


โฑ 5m 58s ยท 737.2k in / 58.0k out ยท $1.83

Annotations

Check warning on line 458 in packages/core/src/js/tracing/reactnavigation.ts

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

Stale `pendingExpoRouterNavigation` can incorrectly tag unrelated React Navigation spans

If `router.back()` or `router.dismiss()` is called when there is nothing to navigate back to (a silent no-op โ€” no exception, no React Navigation state change), `consumePendingExpoRouterNavigation()` is never called, so the pending value stays set and will be consumed by the next unrelated navigation, tagging its span with the wrong `navigation.method`.