Repository navigation
feat(nav3): Add the built-in SerialNameAndProperties BackStackEntryMapper - #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 was referenced Nov 23, 2026
docs(android): Document Nav3 built-in SerialName back stack entry mapper
getsentry/sentry-docs#20948
Open
0xadam-brown
force-pushed
the
feat/nav3-serial-name-mappers-base
branch
from
November 24, 2026 10:20
3dc7c0a to
0441799
Compare
This was referenced Nov 24, 2026
0xadam-brown
marked this pull request as draft
November 25, 2026 15:37
4 of 9 tasks
0xadam-brown
changed the base branch from
main
to
feat/nav3-serial-name-stack-5
December 1, 2026 01:31
0xadam-brown
force-pushed
the
feat/nav3-serial-name-mappers-base
branch
from
December 1, 2026 01:31
0441799 to
4be993a
Compare
0xadam-brown
marked this pull request as ready for review
December 1, 2026 01:49
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 SerialNameAndProperties Mapper)
This stack follows the
SerialNamestack (#6780) and is based on its last PR, #6783.📜 Description
Introduces
BackStackEntryMapper.SerialNameAndProperties, the second of two built-in mappers for kotlinx.serialization. (See the "Motivation and Context" section below for more info about why we need mappers in the first place.) The first,SerialName, was added by the #6780 PR stack.For an entry like this...
...the two built-in mappers create Sentry data like this:
SerialName(#6780)SerialNameAndPropertiesThe high-level processing path for SerialNameAndProperties
Failure modes
unknown_entry_reason(just like withSerialName).{"dropped_by_sentry": "encoding_failed"}.kotlinx-serialization-coreversion can't run our properties encoder, entries keep their names but the arguments of every entry with properties are dropped with "encoding_failed". (If the version is incompatible with the mapper itself, every entry is recorded as "/unknown" withunknown_entry_reason"kotlinx_serialization_version", as withSerialName.)💡 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 to be displayed in Sentry, each of those entries has to be mapped to a Sentry name (e.g., ProductDetailScreen) and zero or more arguments (e.g., productId="123abc"). There are two ways for us to get those mappings:
BackStackEntryMapperthe host app implements itself; orSupporting SAGP auto-instrumentation for Nav3 relies on (2). This PR stack and the
SerialNamestack give us the mappers we need. (Nav3 auto-instrumentation will be implemented in subsequent PRs.)addresses: JAVA-787 (link)
Before
Extracting Sentry data from back stack entries was the responsibility of host apps via custom implementations of the
BackStackEntryMapperinterface. Like this:After
Now host apps can use the built-in mapper instead of implementing their own, whether as-is...
Like this:
...or filtering out sensitive / unwanted properties...
...or as a fallback within their own custom mapper:
This PR stack covers all the gory details of what introducing that built-in mapper requires. Have fun!
PR by PR
ArgumentSinkseam back inArgumentSanitizer, andKotlinxPropertiesEncoder, which encodes an entry's properties within the argument limits and filters sensitive keysKotlinxArgumentSource, which encodes an entry's properties lazily, and theencoding_faileddrop reasonSerialNameAndPropertiesmapper and its encoder compatibility checkSerialNameAndProperties, and the Performance tab can measure itSerialNameAndPropertiesaddresses: 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
mainonce feat(nav3): Add the built-in SerialName BackStackEntryMapper #6780 merges.#skip-changelog