feat(tracing): Add breadcrumbs for dispatched React Navigation events #6218
2 issues
find-bugs: Found 2 issues (2 low)
Low
Breadcrumb message falsely reports 'NAVIGATE' when action type is unknown - `packages/core/src/js/tracing/reactnavigation.ts:357-365`
When actionType is undefined, the message says Dispatched NAVIGATE but the data object omits action_type, so the message contradicts the structured data and misattributes the dispatch type.
App-restart dispatch breadcrumb test passes trivially without exercising the guard - `packages/core/test/tracing/reactnavigation.test.ts:1800-1826`
The new test 'does not create dispatch breadcrumb for app restart' (reactnavigation.test.ts:1800โ1826) calls mockNavigation.finishAppStartNavigation(), which only fires the state listener and never the __unsafe_action__ listener. Since the navigation.dispatch breadcrumb is emitted exclusively inside startIdleNavigationSpan (reactnavigation.ts:353) โ which is wired to the __unsafe_action__ listener โ the breadcrumb code path is never reached in this test. The assertion expect(dispatchCall).toBeUndefined() therefore passes regardless of whether the !isAppRestart guard exists, so the real app-restart suppression path (invoked via getAppRegistryIntegration โ onRunApplication โ startIdleNavigationSpan(undefined, true)) remains unverified.
โฑ 7m 27s ยท 600.3k in / 36.3k out ยท $1.29