Repository navigation
fix(nav3): Send Nav3 context with snake_case keys - #6860
Open
0xadam-brown wants to merge 1 commit into
Open
0xadam-brown wants to merge 1 commit into
0xadam-brown wants to merge 1 commit into
Conversation
Contributor
PR risk: mediumFor commit Main concerns: data sent to Sentry, public contract, reach. This label is a hint for reviewers, not an approval. |
📲 Install BuildsAndroid
|
0xadam-brown
marked this pull request as ready for review
December 4, 2026 13:32
0xadam-brown
requested review from
markushi and
romtsn
and removed request for
a team
December 4, 2026 13:32
5 of 9 tasks
…ke_case keys The navigation context was sent as "Navigation" with a "Back Stack" field so the Sentry UI, which shows unrecognized contexts as-is, would display readable labels. Every other context uses lowercase snake_case keys, so send "android_navigation" and "back_stack" and let the UI supply the labels by recognizing the context, as it does for flutter_context. The android_ prefix keeps the key from colliding with a context an app sets itself under "navigation", and follows the platform-scoped flutter_context pattern. The Nav3 integration is experimental, so the key change ships without a deprecation period. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0xadam-brown
changed the base branch from
feat/nav3-serial-name-stack-base
to
main
December 4, 2026 13:56
0xadam-brown
force-pushed
the
0xadam-brown/ref/nav3-snake-case-context-keys
branch
from
December 4, 2026 13:56
1a223e9 to
ad27c63
Compare
runningcode
approved these changes
Dec 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Sends the Nav3 navigation context with snake_case keys:
NavigationnavigationBack Stackback_stackThe entry fields (
entry,entry_arguments) were already snake_case.💡 Motivation and Context
Follows up on this review comment on #6702.
#6218 chose
Navigation/Back Stackbecause the Sentry UI shows an unrecognized context's keys as they're sent, so lowercase keys made the Navigation card look different from the built-in contexts. But every other context uses lowercase snake_case keys on the wire (os,app,flutter_context, ...), and the keys become a permanent contract once Nav3 is no longer experimental. Display labels belong in the UI.Why android_navigation?
The context key is
android_navigationrather thannavigation. Context keys share one namespace with the contexts apps set themselves (the user docs say "There are no restrictions on context name"), and the Sentry UI applies its special rendering to any context whose key it recognizes. A barenavigationkey could collide with an app's own context.Platform-specific contexts already scope their keys by platform (
flutter_context,react_native_context,dart_context), so this follows the same pattern. The back stack entry shape isn't specific to Nav3, so other Android navigation integrations, such as Nav2, can reuse the key.Sentry UI change needed
The Sentry UI identifies a context by its key when the context has no
typefield (getContextTypeinstatic/app/components/events/contexts/utils.tsx). This is howflutter_contextgets its "Flutter" title and field labels.I'll post a follow-up Sentry PR to register
navigationthe same way, with "Navigation" as the title and "Back Stack" as the label forback_stack. Notypefield is needed in the payload, which matches sentry-java's other contexts (app,art,gpu).Until that UI change ships, the card shows the raw snake_case keys.
This is a breaking change. Nav3 is experimental, and so there's no deprecation period. Events already ingested keep their old keys and still display as before.
beforeSendcallbacks or data-scrubbing rules that targetNavigation/Back Stackneed to switch to the new keys (as mentioned in the CHANGELOG).💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
navigationcontext with display labels.🤖 Generated with Claude Code