Skip to content

ref(android): Extract shared nav sample app infrastructure into common package - #6220

Open
0xadam-brown wants to merge 1 commit into
ref/sentry-nav-effect-performancefrom
ref/extract-shared-sample-app-infra
Open

0xadam-brown wants to merge 1 commit into
ref/sentry-nav-effect-performancefrom
ref/extract-shared-sample-app-infra

Conversation

@0xadam-brown

Copy link
Copy Markdown
Member

📜 Description

Move shared nav sample app infrastructure into the io.sentry.samples.android.navigation.common package and isolate the existing Nav2 implementation under its own package.

💡 Motivation and Context

Lays the groundwork for the Nav3 sample app, which will make use of the .common classes.

💚 How did you test it?

Manually via sample app installation / interaction.

📝 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

  • PR for the Nav3 sample app proper.

…on package

Move shared navigation sample infrastructure into the io.sentry.samples.android.navigation.common package and isolate the existing Nav2 implementation under its own package. Keep Nav2 performance controls focused while wiring route-work support and launcher resources for the sample foundation.

Lays the groundwork for the Nav3 sample app.

Co-Authored-By: Codex <noreply@openai.com>
@0xadam-brown 0xadam-brown added the ship-it PR is ready to merge from a reviewer perspective label Oct 5, 2026
@sentry

sentry Bot commented Oct 5, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@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 4 potential issues.

Fix All in Cursor

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

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ebef890. Configure here.

scenario = Nav2Scenario.COMPOSE,
scenario =
if (currentRoute.startsWith("/${RouteNames.CUSTOM}")) Nav2Scenario.CUSTOM
else Nav2Scenario.COMPOSE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Custom flow freezes top bar

Medium Severity

updateComposeNavigationUi treats only routes that start with /Custom as the Custom tab. Product List and later Custom-flow destinations are stored under Compose, and the header does not refresh while Custom stays selected, so the displayed route and back stack go stale.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ebef890. Configure here.

}
}
else -> Unit
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Custom tab drops Home root

Medium Severity

Entering the Custom tab navigates with popUpTo(Home) inclusive, which removes the shared graph root. Later Home-based resets and Compose tab switches cannot pop that destination, so the real NavController stack and the tracked list diverge. Opening Compose also re-pushes Home and emits an extra navigation event.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ebef890. Configure here.

routeSpec,
arguments =
mapOf(
Nav2Args.PRODUCT_ID to productId,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Custom routes tagged as Compose

Medium Severity

TracedNav2ComposeRoute always calls tagCurrentNav2Scenario with Nav2Scenario.COMPOSE. On the Custom tab the current span is the bound custom transaction, so sample_nav2_scenario is overwritten from Custom to Compose.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ebef890. Configure here.

var customTransactionMode by rememberSaveable {
mutableStateOf(Nav2CustomTransactionMode.PER_SCREEN)
}
var asyncBrowseProductsJob by rememberSaveable { mutableStateOf<Job?>(null) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Job stored in rememberSaveable

Medium Severity

asyncBrowseProductsJob is held in rememberSaveable, but Job cannot be written to a Bundle. If onSaveInstanceState runs while the 250ms async browse job is active, state saving throws.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ebef890. Configure here.

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

ship-it PR is ready to merge from a reviewer perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant