Repository navigation
feat(nav3): Add built-in BackStackEntryMappers for kotlinx.serialization - #6696
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
This was referenced Nov 20, 2026
Contributor
|
This was referenced Nov 20, 2026
📲 Install BuildsAndroid
|
This was referenced Nov 20, 2026
Closed
3 of 9 tasks
0xadam-brown
marked this pull request as ready for review
November 20, 2026 16:23
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.
PR Stack (Nav3 Serial Name Mappers)
📜 Description
Introduces two built-in
BackStackEntryMappersmappers for kotlinx.serialization so host apps don't have to define their own.For an entry like this...
...the built-in mappers create Sentry data like this:
SerialNameSerialNameAndPropertiesThe high-level processing path:
Failure modes
dropped_by_sentryreason.💡 Motivation and Context
With Nav3, host apps manage their own nav back stack, which they implement as a list of arbitrarily typed entries. In order for us to display telemetry for those entries, someone has extract a Sentry name (e.g., ProductDetailScreen) and zero or more arguments (e.g., productId="abc1234") from them.
Before
Prior to this PR stack, extracting that data was the responsibility of host apps, via custom implementations of the
BackStackEntryMapperinterface, like this:After
This PR stack introduces two convenience mappers that host apps can use ii) instead of implementing their own or ii) as a fallback within their own custom mapper.
Like this:
Uses a new built-in mapper directly.
Or this:
Uses a built-in mapper but filters specific properties from all entries (e.g., because they contain PII).
Or this:
Uses a custom mapper to special-case entries as needed, and falls back back to a built-in mapper for the rest.
This PR stack covers all the gory details of what introducing those built-in mappers requires. Have fun!
addresses: JAVA-787 (link)
🔍 Due diligence
See the "Callouts" section in #6707 for a discussion of the performance impact of this PR stack, as well as leak memory concerns, and potential for crashing the host app. (Spoiler alert: no issues were found.)
💚 How did you test it?
(See individual PRs.)
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog