Skip to content

feat(nav3): Add the built-in SerialName BackStackEntryMapper - #6780

Draft
0xadam-brown wants to merge 1 commit into
mainfrom
feat/nav3-serial-name-stack-base
Draft

0xadam-brown wants to merge 1 commit into
mainfrom
feat/nav3-serial-name-stack-base

Conversation

@0xadam-brown

@0xadam-brown 0xadam-brown commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Nav3 SerialName Mapper)

This stack replaces the SerialName half of #6696. SerialNameAndProperties will 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 to SentryNavEffect instead of writing a mapper for every destination:

SentryNavEffect(
  backStack = backStack,
  backStackEntryMapper = BackStackEntryMapper.SerialName,
)

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.

Part What it adds
1 One shared writer that enforces argument limits, used for custom mappers' arguments today and for the properties mapper later
2 The SerialName mapper, kotlinx.serialization as a dependency at 1.7.3 or later, and a compatibility probe
3 unknown_entry_reason next to every /unknown entry, e.g., not_serializable or serializer_not_found
4 The Android Nav3 sample app uses SerialName
5 An R8 check app that verifies serial names in minified builds on an emulator
6 CI that runs the R8 check and unit tests against the floor, the latest stable release, and newer release candidates

💡 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. Shipping SerialName on its own lets apps use it sooner, and shows us what real back stack keys look like before we commit to an argument format. SerialNameAndProperties will 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

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

  • Document SerialName and the unknown_entry_reason values in sentry-docs, including the Troubleshooting section the KDoc links to.
  • A second stack for SerialNameAndProperties.

@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

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 #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 8fb26b4

@sentry

sentry Bot commented Nov 25, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.1 (1) release

⚙️ sentry-android Build Distribution Settings

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant