Skip to content

feat(tracing): Add breadcrumbs for dispatched React Navigation events#6218

Merged
antonis merged 5 commits into
mainfrom
feat/navigation-dispatch-breadcrumbs
May 27, 2026
Merged

feat(tracing): Add breadcrumbs for dispatched React Navigation events#6218
antonis merged 5 commits into
mainfrom
feat/navigation-dispatch-breadcrumbs

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented May 26, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Adds a navigation.dispatch breadcrumb every time a React Navigation action is dispatched, before the navigation state settles. This gives visibility into the full sequence of navigation events (NAVIGATE, GO_BACK, POP, SET_PARAMS, OPEN_DRAWER, etc.) rather than only completed navigations.

  • Breadcrumb includes action_type and target route name (when available in the action payload)
  • Works regardless of useDispatchedActionData — the flag only controls span behavior, not breadcrumbs
  • Noop actions and app restart dispatches are excluded
  • Existing navigation breadcrumbs on completed navigations are unchanged

💡 Motivation and Context

Currently breadcrumbs are only created for finished navigations, after the state has changed. This makes it hard to debug navigation issues because dispatched events that don't result in a state change (e.g. cancelled navigations, drawer toggles) leave no trace.

Fixes #4904

💚 How did you test it?

  • 8 new unit tests covering: default config, useDispatchedActionData enabled, GO_BACK, SET_PARAMS, drawer actions, noop filtering, completed navigation breadcrumb coexistence, app restart exclusion
  • Full test suite: 1470/1470 passing
  • Lint, build, circular dep check all clean

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(tracing): Add breadcrumbs for dispatched React Navigation events by antonis in #6218
  • feat(tracing): Add Sentry.NavigationContainer wrapper for React Navigation by antonis in #6199
  • chore(e2e): Update Expo sample to SDK 56 by antonis in #6216
  • feat(ios): opt-in consumption of sentry-cocoa via Swift Package Manager by alwx in #6182
  • chore(deps): bump getsentry/craft from 2.26.5 to 2.26.6 by dependabot in #6213
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.26.5 to 2.26.6 by dependabot in #6214
  • chore(deps): bump github/codeql-action from 4.35.5 to 4.36.0 by dependabot in #6215
  • fix(ios): Return NO from requiresMainQueueSetup by antonis in #6202
  • fix(tracing): Bound TTID/TTFD to prevent inflated transactions by antonis in #6210
  • feat(core): Add disableAutoUpload option to Expo plugin by antonis in #6195
  • chore(deps): Remove unused @sentry/types dependency by antonis in #6207
  • Correct route and dynamic param extraction for Expo Router (Correct route and dynamic param extraction for Expo Router #6157) by alwx in #6197
  • chore(deps): update CLI to v3.4.3 by github-actions in #6205
  • chore(deps): update Cocoa SDK to v9.14.0 by github-actions in #6204
  • chore(deps): update Maestro to v2.6.0 by github-actions in #6198
  • chore(deps): bump js-cookie from 3.0.5 to 3.0.7 by dependabot in #6203
  • chore(deps): bump @tootallnate/once from 2.0.0 to 2.0.1 by dependabot in #6206
  • chore(deps): update Sentry Android Gradle Plugin to v6.8.1 by github-actions in #6196
  • feat(core): Expose pauseAppHangTracking and resumeAppHangTracking APIs by antonis in #6192

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a43cd2b

Comment thread CHANGELOG.md Outdated
@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented May 26, 2026

@sentry review

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented May 26, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 12a0b96. Configure here.

Comment thread packages/core/src/js/tracing/reactnavigation.ts
Comment thread packages/core/src/js/tracing/reactnavigation.ts Outdated
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@antonis antonis marked this pull request as ready for review May 26, 2026 09:57
Copy link
Copy Markdown
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

LGTM!

@antonis antonis enabled auto-merge (squash) May 27, 2026 10:34
@antonis antonis merged commit 267d3ed into main May 27, 2026
50 of 64 checks passed
@antonis antonis deleted the feat/navigation-dispatch-breadcrumbs branch May 27, 2026 10:58
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.

[React Navigation] Create breadcrumbs for dispatched events

2 participants