Skip to content

feat(nav3): [Part 5] Add 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 Serial Name Mappers)

Former parts 1–3 merged into main as #6697, #6698, and #6699; preparatory refactors merged in #6749. Two other former parts merged separately as #6713 and #6714.


📜 Description

BackStackEntryMapper.SerialNameAndProperties lets an application opt into recording serializable route properties alongside destination names. That gives navigation reports useful context without requiring a custom mapper for each route, while keeping the resulting arguments subject to the same back stack limits as custom output.

Before collecting properties, the mapper checks that the app’s serialization runtime can encode a known fixture correctly. 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. This keeps navigation identity useful even when a particular route's diagnostic data cannot be represented.

The KotlinxArgumentSource that encodes properties into Sentry arguments is reviewed separately in #6751 (Part 4); this PR wires it into the mapper.

💡 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?

Nav3 release build and unit tests passed. Repository-wide make format api, Spotless checks, ABI validation, and Detekt passed. The full suite also passed against serialization 1.13.0.

📝 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 6: Demonstrate the built-in mappers.

⚠️ 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 1f9a83c

@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: not classified

For commit 1f9a83c.

The last run ended with status provider_error, so this pull request has no risk label.

@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 from 782f546 to 122ad95 Compare November 23, 2026 15:34
Records each back stack entry's kotlinx.serialization properties as
arguments, in addition to its serial name.

When the mapper is created, its compatibility probe encodes an SDK-owned
fixture and compares the result with the known-good output. Any failure
or mismatch, including a LinkageError, disables property encoding for
every entry, which then keeps its name and records encoding_failed,
since recording wrong arguments is worse than recording none.
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-mappers-8 branch 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

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

sanity-check PR needs a lightweight review for obvious issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant