Uh oh!
There was an error while loading. Please reload this page.
fix(ui): re-seat nested SSO wizard to provider selection when connection is reset - #8970
Conversation
…ion is reset Resetting a connection from the first per-provider configure step left a blank screen instead of returning to provider selection. The configure sub-flow runs in a nested wizard whose configure-provider step is gated on an existing connection; deleting the connection broke that guard, but the reachability clamp that re-seats the wizard to its first reachable step was gated on the top-level wizard only, so the nested wizard stranded on an impossible step that renders nothing. Run the clamp for nested wizards too. The re-seat is a local state update over the wizard's own descriptors, so it falls back to provider selection in place without bubbling to the parent.
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 034335e The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/astro@clerk/backend@clerk/chrome-extension@clerk/clerk-js@clerk/electron@clerk/electron-passkeys@clerk/eslint-plugin@clerk/expo@clerk/expo-passkeys@clerk/express@clerk/fastify@clerk/hono@clerk/localizations@clerk/nextjs@clerk/nuxt@clerk/react@clerk/react-router@clerk/shared@clerk/tanstack-react-start@clerk/testing@clerk/ui@clerk/upgrade@clerk/vuecommit: |
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughRemoves the ChangesNested Wizard Reachability Clamp Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
| // ORGS-1675: resetting from the FIRST per-provider configure step (not the test | ||
| // step) must also land on select-provider. The configure sub-flow runs inside a | ||
| // NESTED wizard whose `configure-provider` step is gated on `hasConnection`; | ||
| // deleting the connection breaks that guard. Before the fix the nested clamp was | ||
| // skipped (gated on `!isNested`), so the wizard stranded on `configure-provider` | ||
| // — which renders nothing without a provider — leaving a blank pane. The clamp | ||
| // now runs for the nested wizard too and re-seats it in place to select-provider. |
There was a problem hiding this comment.
| // ORGS-1675: resetting from the FIRST per-provider configure step (not the test | |
| // step) must also land on select-provider. The configure sub-flow runs inside a | |
| // NESTED wizard whose `configure-provider` step is gated on `hasConnection`; | |
| // deleting the connection breaks that guard. Before the fix the nested clamp was | |
| // skipped (gated on `!isNested`), so the wizard stranded on `configure-provider` | |
| // — which renders nothing without a provider — leaving a blank pane. The clamp | |
| // now runs for the nested wizard too and re-seats it in place to select-provider. |
| // ConfigureSSO's middle wizard is nested AND has a guarded step | ||
| // (`configure-provider`, reachable only while a connection exists). When that | ||
| // connection is deleted from inside the flow, the guard breaks; the clamp must | ||
| // re-seat to the furthest LOCAL reachable step (n0 here, select-provider in the | ||
| // app) IN PLACE rather than bubbling to the parent — otherwise the nested | ||
| // wizard strands on an impossible step (the ORGS-1675 blank pane). |
There was a problem hiding this comment.
| // ConfigureSSO's middle wizard is nested AND has a guarded step | |
| // (`configure-provider`, reachable only while a connection exists). When that | |
| // connection is deleted from inside the flow, the guard breaks; the clamp must | |
| // re-seat to the furthest LOCAL reachable step (n0 here, select-provider in the | |
| // app) IN PLACE rather than bubbling to the parent — otherwise the nested | |
| // wizard strands on an impossible step (the ORGS-1675 blank pane). |
What
Resetting (deleting) a connection from the first per-provider configure step in
<ConfigureSSO />left the user on a blank screen instead of returning to provider selection.Why
The wizard self-corrects to the furthest-reachable step when the active step's reachability predicate breaks, but that correction was gated to top-level (non-nested) wizards only. The provider-selection → per-provider-config flow runs as a nested wizard whose
configure-providerstep is reachable only while a connection exists. On reset the connection is deleted and that step becomes unreachable, but because the wizard is nested the correction never ran — it stayed onconfigure-provider, which renders nothing without a connection, producing the blank.Resetting from a later step (e.g. Test) already worked, because that path re-seats the outer wizard and remounts the nested wizard fresh. Resetting from inside the nested wizard needed the nested wizard itself to re-seat in place.
How
Remove the
!isNestedgate on the reachability clamp inuseWizardMachine.tsso the clamp runs for nested wizards too. The nested wizard re-derives to its furthest reachable local step (select-provider) in place, via the sameinitialStatederivation used on mount — a local state update, never bubbling to the parent. Scope is contained: the only nested step today with a reachability predicate isconfigure-provider; the per-provider inner wizards are guard-less, so the clamp is inert for them.Testing
select-provider(no blank), mirroring the existing reset-from-test-step case.ConfigureSSO+OrganizationSecurityPagesuites pass (193 tests); existing flows confirmed unchanged (reset-from-test, resume-skips-selection, forward nav, change-provider).Resolves ORGS-1675
Summary by CodeRabbit