feat(android): Improve SentryNavEffect by consolidating back stack entry mapping (JAVA-274) - #6197
Merged
Merged
Conversation
Contributor
|
📲 Install BuildsAndroid
|
0xadam-brown
force-pushed
the
ref/sentry-nav-effect-consolidate-extractors
branch
from
September 30, 2026 20:04
0a1a393 to
3a694a1
Compare
0xadam-brown
commented
Sep 30, 2026
…ute mapping (JAVA-274) Commit improves the yet-to-be-released SentryNavEffect by replacing separate route name and argument extractors with a single BackStackEntryMapper. Doing so lets us spare users from having to create three giant `when` statements mapping all nav entries in their entire app (two for us and one for Nav3's entryProvider). After this commit, users only have to create two. (Future work will allow them to create just one via a forthcoming Sentry entryProvider wrapper.) Commit also uses the term "back stack entry" rather than "back stack route" throughout to avoid developer confusion, given Google's use of "route" to mean (essentially) a navigation destination. By contrast, we need a term that refers solely to an element in the host app's back stack. (In general, Nav3 is careful to distinguish between nav destinations and back stack entries, as a destination may be composed from multiple entries in a back stack.)
0xadam-brown
force-pushed
the
ref/sentry-nav-effect-consolidate-extractors
branch
from
September 30, 2026 20:57
3a694a1 to
dc803d2
Compare
0xadam-brown
marked this pull request as ready for review
September 30, 2026 20:58
0xadam-brown
requested review from
adinauer,
markushi,
romtsn and
runningcode
as code owners
September 30, 2026 20:58
markushi
approved these changes
Oct 1, 2026
markushi
reviewed
Oct 1, 2026
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
PR improves the yet-to-be-released
SentryNavEffectby replacing separate name and argument extractors with a singleBackStackEntryMapper.I've also updated terminology throughout to use "back stack entry" rather than "back stack route". That should avoid some developer confusion, given Google's use of "route" to mean (essentially) a navigation destination. By contrast, we need a term that refers solely to an element in the host app's back stack.
(In general, Nav3 is careful to distinguish between nav destinations and back stack entries, as a destination may be composed from multiple entries.)
💡 Motivation and Context
Lets us spare users from having to create three giant
whenstatements mapping all the nav entries in their entire app (two for us and one for Nav3's entryProvider). Now users only have to create two.A future PR will allow them to create just the one Google requires via a forthcoming Sentry entryProvider wrapper. That work will make use of the BackStackEntryMapper introduced here.
addresses: JAVA-274
💚 How did you test it?
Unit tests
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
@ApiStatus.Internalannotations from SentryNavEffect, SentryNavOptions, RouteNameExtractor, and RouteArgumentsExtractor once we're ready to release publicly + add an appropriate CHANGELOG entry + publish the module via craft (link).rememberSentryEntryProvider()method that lets us extract Sentry back stack entry info from the mapping users already have to do on behalf ofNavDisplay. (We don't have to hold up release of Nav3 support for this.)#skip-changelog