Skip to content

feat(nav3): [Part 4] Use the SerialName mapper in the Android samples - #6782

Draft
0xadam-brown wants to merge 1 commit into
feat/nav3-serial-name-stack-3from
feat/nav3-serial-name-stack-4
Draft

0xadam-brown wants to merge 1 commit into
feat/nav3-serial-name-stack-3from
feat/nav3-serial-name-stack-4

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

Switches the Nav3 samples in sentry-samples-android to BackStackEntryMapper.SerialName:

  • Single-stack sample: names each route with SerialName and adds the route's own arguments, in a small wrapper. This shows the pattern the KDoc recommends (fall back to a built-in mapper for names, and choose the arguments yourself), and keeps the sample exercising argument handling.
  • Multi-Activity, multi-Fragment, and ViewPager2 samples: use SerialName directly.
  • Performance scenario: a new "Mapper" control switches between the existing custom mapper, which times name and argument extraction separately, and SerialName itself, so SentryNavEffect.onBackStackChanged measures the built-in mapper's real lookups.

The routes become @Serializable, with the Nav2 sample's route names as their serial names, so both samples send the same names. Members other than a route's constructor properties are getters, so they aren't serialized.

💡 Motivation and Context

The samples are where we try the mapper by hand, on a device, with real Nav3 back stacks. They now exercise the code path we recommend to apps.

addresses: JAVA-787 (link)

💚 How did you test it?

  • ./gradlew -p sentry-android-integration-tests :sentry-samples-android:compileDebugKotlin
  • Manual testing in the sample app is still to do

📝 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

The SerialNameAndProperties stack will switch the samples to that mapper.

@github-actions

github-actions Bot commented Nov 25, 2026 •

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

- [Part 4] Use the SerialName mapper in the Android samples ([#6782](https://github.com/getsentry/sentry-java/pull/6782))

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 cd7e549

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit cd7e549.

The model rated this change low. It was raised to medium because:

  • R6: build or release configuration changed: sentry-android-integration-tests/build.gradle.kts, sentry-android-integration-tests/sentry-samples-android/build.gradle.kts
  • R7: the model was not confident enough that the change is low

This label is a hint for reviewers, not an approval.

The routes are @serializable with the Nav2 sample's route names as their serial names. The
single-stack sample names them with BackStackEntryMapper.SerialName and adds each route's own
arguments, and the multi-root samples use SerialName directly. The performance scenario can run
SerialName itself, to measure its name lookups, as well as the custom mapper.
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-3 branch from c3bbd3c to cfbf6ca Compare November 25, 2026 16:31
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-4 branch from 37996b3 to cd7e549 Compare November 25, 2026 16:31
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 25, 2026
@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

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant