Skip to content

feat(nav3): [Part 3] Introduce the built-in SerialNameAndProperties mapper - #6706

Open
0xadam-brown wants to merge 1 commit into
feat/nav3-serial-name-mappers-argument-sourcefrom
feat/nav3-serial-name-mappers-9
Open

0xadam-brown wants to merge 1 commit into
feat/nav3-serial-name-mappers-argument-sourcefrom
feat/nav3-serial-name-mappers-9

Conversation

@0xadam-brown

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

Copy link
Copy Markdown
Member

PR Stack (Nav3 SerialNameAndProperties Mapper)

This stack follows the SerialName stack (#6780) and is based on its last PR, #6783.


📜 Description

Introduces the public API on top of the kotlinx.serialization encoder introduced in #6751, viz., BackStackEntryMapper.SerialNameAndProperties.

Lets an application easily record serializable back stack entry properties alongside destination names.

Before collecting properties, the mapper checks that the app’s serialization runtime can encode a known value correctly, using kotlinx.serialization's built-in serializers. If the check throws or produces unexpected output, it disables property collection while continuing to record destination names. This avoids presenting incorrect arguments as useful route context.

A nonfatal property encoding failure preserves the destination's name and records why its arguments were dropped.

💡 Motivation and Context

Let's host apps that want to serialize back stack entry names and properties easily do so.

addresses: JAVA-787 (link)

⚠️ Callouts

See the "Callouts" section in #6703 for a discussion of why I exposed the built-in mappers as properties rather than methods.

💚 How did you test it?

  • Unit tests
  • Manual tests via the Nav3 sample app
  • Performance tests via the Nav3 sample app's "Performance" tab
  • Clanker stress tests

📝 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

Continue with Part 4: Use SerialNameAndProperties in the Android samples.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 0e209b0

@sentry

sentry Bot commented Nov 20, 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

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 0e209b0.

Main concerns: data sent to Sentry, public contract, host performance.

Rules that block low also fired:

  • R1: code was truncated, omitted or a reduced context was used: sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/internal/backstack/SerialNameAndPropertiesArgumentLimitsTest.kt, sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/internal/backstack/SerialNameAndPropertiesParityTest.kt, sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/internal/backstack/kotlinx/KotlinxBackStackEntryMapperEncoderCheckTest.kt, sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/internal/backstack/kotlinx/KotlinxBackStackEntryMapperPropertiesTest.kt, sentry-android-navigation3/src/test/kotlin/io/sentry/compose/navigation3/internal/backstack/kotlinx/KotlinxBackStackEntryMapperTest.kt and 3 more
  • R4: a public API record changed: sentry-android-navigation3/api/sentry-android-navigation3.api
  • R6: build or release configuration changed: sentry-android-navigation3/proguard-rules.pro

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

@github-actions github-actions Bot removed the risk: medium PR risk score: medium label Nov 20, 2026
@0xadam-brown 0xadam-brown changed the title feat(nav3): [Nav3 Mappers 9] Add SerialNameAndProperties feat(nav3): [Part 9] Add SerialNameAndProperties Nov 20, 2026
@0xadam-brown 0xadam-brown changed the title feat(nav3): [Part 9] Add SerialNameAndProperties feat(nav3): [Part 9] Add the built-in SerialNameAndProperties mapper Nov 20, 2026
@0xadam-brown
0xadam-brown marked this pull request as ready for review November 20, 2026 15:38
@0xadam-brown
0xadam-brown requested review from a team and adinauer as code owners November 20, 2026 15:38
@0xadam-brown
0xadam-brown requested review from romtsn and runningcode and removed request for a team November 20, 2026 15:38
@0xadam-brown 0xadam-brown added the sanity-check PR needs a lightweight review for obvious issues label Nov 20, 2026
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-9 branch 2 times, most recently from 8c1faf4 to ec9fb95 Compare November 23, 2026 13:11
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-8 branch from 546f3b8 to d2d0c6e Compare November 23, 2026 13:11
@0xadam-brown 0xadam-brown changed the title feat(nav3): [Part 9] Add the built-in SerialNameAndProperties mapper feat(nav3): [Part 7] Add the built-in SerialNameAndProperties mapper Nov 23, 2026
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-8 branch from d2d0c6e to 782f546 Compare November 23, 2026 14:28
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-9 branch 2 times, most recently from a3d765c to 52103fe Compare November 23, 2026 15:34
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-8 branch 2 times, most recently from 122ad95 to f4a7b52 Compare November 24, 2026 10:21
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-9 branch from 52103fe to 1f9a83c Compare November 24, 2026 10:21
@0xadam-brown 0xadam-brown changed the title feat(nav3): [Part 7] Add the built-in SerialNameAndProperties mapper feat(nav3): [Part 5] Add the built-in SerialNameAndProperties mapper Nov 24, 2026
@0xadam-brown
0xadam-brown changed the base branch from feat/nav3-serial-name-mappers-8 to feat/nav3-serial-name-mappers-argument-source November 24, 2026 10:23
@0xadam-brown
0xadam-brown marked this pull request as draft November 25, 2026 15:37
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-argument-source branch from 849c9d0 to ef7030c Compare December 1, 2026 01:31
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-9 branch from 1f9a83c to 857e5ed Compare December 1, 2026 01:31
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@0xadam-brown 0xadam-brown changed the title feat(nav3): [Part 5] Add the built-in SerialNameAndProperties mapper feat(nav3): [Part 3] Add the built-in SerialNameAndProperties mapper Dec 1, 2026
@0xadam-brown
0xadam-brown marked this pull request as ready for review December 1, 2026 01:49
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
Add BackStackEntryMapper.SerialNameAndProperties, which names entries as
SerialName does and also records each entry's kotlinx.serialization
properties as arguments, through KotlinxArgumentSource.

Creating the mapper checks that the properties encoder works with the
app's kotlinx.serialization version by encoding a known value with
built-in serializers, as the name check does, and comparing the output
with its known encoding. Any failure or mismatch keeps entry names but
drops every entry's arguments with encoding_failed, since recording wrong
arguments is worse than recording none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@0xadam-brown 0xadam-brown changed the title feat(nav3): [Part 3] Add the built-in SerialNameAndProperties mapper feat(nav3): [Part 3] Introduce the built-in SerialNameAndProperties mapper Dec 1, 2026
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-argument-source branch from ef7030c to 81bf950 Compare December 1, 2026 10:01
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-9 branch from 857e5ed to 0e209b0 Compare December 1, 2026 10:01
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026

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 sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants