Repository navigation
feat(nav3): Add the built-in SerialName BackStackEntryMapper - #6780
Draft
0xadam-brown wants to merge 1 commit into
Draft
0xadam-brown wants to merge 1 commit into
0xadam-brown wants to merge 1 commit into
Conversation
This was referenced Nov 25, 2026
Contributor
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
### Features
- Add the built-in SerialName BackStackEntryMapper ([#6780](https://github.com/getsentry/sentry-java/pull/6780))If none of the above apply, you can opt out of this check by adding |
5 of 9 tasks
📲 Install BuildsAndroid
|
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 SerialName Mapper)
This stack replaces the
SerialNamehalf of #6696.SerialNameAndPropertieswill follow in its own stack.📜 Description
Adds
BackStackEntryMapper.SerialName, a built-in mapper for apps whose Nav3 back stack keys are@Serializable. Apps can pass it toSentryNavEffectinstead of writing a mapper for every destination:Each entry is named after its kotlinx.serialization serial name (its
@SerialName, or else its fully qualified class name), which R8 doesn't obfuscate. The mapper records no properties.The stack also records why an entry is
/unknown, for any mapper, so that failures that only happen in minified release builds can be seen in Sentry without debug logs. It also checks the mapper under R8 and against newer kotlinx.serialization releases in CI.SerialNamemapper, kotlinx.serialization as a dependency at 1.7.3 or later, and a compatibility probeunknown_entry_reasonnext to every/unknownentry, e.g.,not_serializableorserializer_not_foundSerialName💡 Motivation and Context
This PR stack is extracted from #6696, which also adds
SerialNameAndProperties. That mapper records each entry's properties as arguments, which needs considerably more machinery (a custom encoder, sensitive-key filtering, and a lazily encoded argument map) and raises its own privacy questions. ShippingSerialNameon its own lets apps use it sooner, and shows us what real back stack keys look like before we commit to an argument format.SerialNameAndPropertieswill follow in its own stack.addresses: JAVA-787 (link)
💚 How did you test it?
See each part. Unit tests run at the kotlinx.serialization floor (1.7.3) and at 1.13.0, and the R8 check passes on an emulator in R8 full and compat mode.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
SerialNameand theunknown_entry_reasonvalues in sentry-docs, including the Troubleshooting section the KDoc links to.SerialNameAndProperties.