Skip to content

feat(nav3): [Part 2] Record why back stack entries are /unknown - #6801

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

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

Conversation

@0xadam-brown

@0xadam-brown 0xadam-brown commented Nov 27, 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.

This PR replaces #6781. A restack that moved this change below the SerialName mapper caused GitHub to mark #6781 as merged, though nothing was merged. Its earlier review discussion is still there.


📜 Description

When Sentry can't name a back stack entry, it records the entry as /unknown. Until now, that's all it recorded. This PR records the reason next to the entry, under unknown_entry_reason:

Where Key
Back stack in the Navigation context unknown_entry_reason
Navigation breadcrumbs to_unknown_entry_reason, from_unknown_entry_reason
Navigation transaction data unknown_entry_reason

Breadcrumbs add the to_ and from_ prefixes their other keys use (to_arguments, from_arguments), as each describes two entries.

For example, a back stack whose top entry's mapper returned null:

"Back Stack": [
  { "entry": "/unknown", "unknown_entry_reason": "unmapped" },
  { "entry": "/Home" }
]

This PR adds the reasons that apply to any mapper. They're a fixed set and contain no app data or class names:

Reason Meaning
unmapped The mapper returned null
mapping_failed The mapper threw
blank_name The mapper returned a blank name (its arguments are kept)

Part 3 (#6703) adds the reasons specific to SerialName, and the side channel it uses to report them while still returning null.

The transaction name stays /unknown, so unnamed screens don't add transaction names.

💡 Motivation and Context

/unknown alone doesn't say what went wrong. A mapper that threw, returned a blank name, or chose not to name an entry all look the same outside debug logs. And all unnamed screens share one transaction name, so a broken setup can look like an app with few screens rather than a problem.

This records the reason where users already look, without changing the public map() contract.

addresses: JAVA-787 (link)

⚠️ Callouts

  • Behavior change: a mapper that throws now records "unknown_entry_reason": "mapping_failed" instead of "dropped_by_sentry": "mapping_failed" in the entry's arguments, so one cause has one name. mapping_failed shipped in 8.65.1 as an argument drop reason, so this changes a released value. The CHANGELOG says so.
  • Not added: a searchable nav.unknown_entry_reason transaction tag. That's a product question, and the tag is easy to add later.

💚 How did you test it?

  • Unit tests for each reason through the converter (BackStackConverterTest), the observer's breadcrumbs, back stack context, and transaction data (BackStackObserverTest), the entry's serialized form (NormalizedSentryBackStackEntryTest), and the transaction request (NavTransactionRequestTest)
  • NavDataContractTest pins each displayed key and value

📝 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 the reasons in sentry-docs' Troubleshooting section.

🤖 Generated with Claude Code

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

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 9909415.

Main concerns: data sent to Sentry, reach, host performance.

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 27, 2026
@github-actions

github-actions Bot commented Nov 27, 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 9909415

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 27, 2026
An entry recorded as /unknown didn't say why, so outside debug logs a
mapper that threw, returned a blank name, or chose not to name an entry
all looked the same. Record the reason next to the entry as
unknown_entry_reason in the back stack context and the nav
transaction's data, and as to_unknown_entry_reason and
from_unknown_entry_reason on breadcrumbs.

The values are mapping_failed, blank_name, and unmapped. A mapper that
throws now records mapping_failed as its unknown entry reason instead
of as its arguments' drop reason, so one cause has one name.
@0xadam-brown
0xadam-brown force-pushed the feat/nav3-serial-name-stack-3 branch from fb33ea0 to 9909415 Compare November 27, 2026 15:27
@github-actions github-actions Bot removed the risk: medium PR risk score: medium label Nov 27, 2026
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 27, 2026
@sentry

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