Skip to content

ref(android): [Nav3 Lifecycle 2] Add lease-aware NavScopes facade - #6304

Merged
0xadam-brown merged 1 commit into
feat/sentry-nav-effect-lifecyclefrom
feat/part-2-sentry-nav-effect-lifecycle
Oct 22, 2026
Merged

0xadam-brown merged 1 commit into
feat/sentry-nav-effect-lifecyclefrom
feat/part-2-sentry-nav-effect-lifecycle

Conversation

@0xadam-brown

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

Copy link
Copy Markdown
Member

PR Stack (Nav3 Lifecycle)


📜 Description

Add a lease-aware NavScopes façade that lets us swizzle nav data writes and reads between:

  • the globally shared IScope, vs
  • an unshared StagedNavData object, specific to each NavScopes instance.

See the NavScopes KDoc for (lots) more info, including a helpful diagram of how lease handoff works.

💡 Motivation and Context

Multiple active navigation roots write to the same Sentry scope. Staging slot-based state prevents an inactive root from overwriting the currently selected root while preserving its latest state for later restoration.

addresses: JAVA-785

💚 How did you test it?

  • Unit tests
  • Integration tests (included in a later PR)
  • New Nav3 sample app flows (also in a later PR) + having my clanker perform lots of thorough manual testing

📝 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 next PR wires this scope layer into SentryNavEffect and enables the user-facing behavior.

#skip-changelog

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

@linear-code

linear-code Bot commented Oct 20, 2026

Copy link
Copy Markdown

JAVA-274

@sentry

sentry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@0xadam-brown
0xadam-brown marked this pull request as ready for review October 20, 2026 15:30
@0xadam-brown 0xadam-brown added the sanity-check PR needs a lightweight review for obvious issues label Oct 20, 2026
@0xadam-brown 0xadam-brown changed the title ref(android): [Nav3 Lifecycle 2] Add lease-aware navigation scopes ref(android): [Nav3 Lifecycle 2] Add lease-aware NavScopes facade Oct 20, 2026
@0xadam-brown
0xadam-brown force-pushed the feat/part-2-sentry-nav-effect-lifecycle branch from 5c8e9cf to d4b69f1 Compare October 21, 2026 11:27
@0xadam-brown
0xadam-brown force-pushed the feat/part-1-sentry-nav-effect-lifecycle branch from 8292382 to a010c9e Compare October 21, 2026 11:27

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Base automatically changed from feat/part-1-sentry-nav-effect-lifecycle to feat/sentry-nav-effect-lifecycle October 22, 2026 07:49
@0xadam-brown
0xadam-brown force-pushed the feat/part-2-sentry-nav-effect-lifecycle branch from 3eac685 to 6d8b5ae Compare October 22, 2026 08:25

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6d8b5ae. Configure here.

Comment thread sentry/src/main/java/io/sentry/protocol/App.java Outdated
Comment thread sentry/src/main/java/io/sentry/protocol/App.java Outdated
Stage navigation scope state for inactive roots and publish it when the root acquires the lifecycle lease.

Refs JAVA-274
@0xadam-brown
0xadam-brown force-pushed the feat/part-2-sentry-nav-effect-lifecycle branch from 6d8b5ae to ebddd61 Compare October 22, 2026 10:11

@romtsn romtsn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 🚀

@0xadam-brown
0xadam-brown merged commit b67f3bf into feat/sentry-nav-effect-lifecycle Oct 22, 2026
27 checks passed
@0xadam-brown
0xadam-brown deleted the feat/part-2-sentry-nav-effect-lifecycle branch October 22, 2026 12:02
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.

2 participants