[codex] Keep desktop app available when Clerk UI fails#3049
[codex] Keep desktop app available when Clerk UI fails#3049juliusmarminge wants to merge 2 commits into
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🚀 Expo continuous deployment is ready!
|
ApprovabilityVerdict: Needs human review This PR modifies authentication-related code (Clerk provider), changing behavior from blocking render on UI load failure to continuing with a promise-based approach. Auth changes warrant human review regardless of simplicity. You can customize Macroscope's approvability policy. Learn more. |
Summary
Root cause
DesktopClerkProvider returned null while waiting for the UI bundle from clerk.t3.codes. Blocking or failing that optional script therefore prevented the router and all application content from mounting.
Impact
The desktop app remains usable when Clerk UI infrastructure is unavailable. Clerk hooks still receive the real provider context, while UI-dependent authentication surfaces remain unavailable until the bundle loads.
Validation
vp checkvp run typecheckvp test run --project browser src/components/clerk/DesktopClerkProvider.browser.tsxFixes #3042
Note
Keep desktop app rendering when Clerk UI bundle fails to load
Previously,
DesktopClerkProviderreturnednulluntil the Clerk UI bundle fully loaded, blocking the app on load errors. Now it renders immediately, passing auseMemo-created thenable as theuiprop toInternalClerkProviderinstead of waiting for the resolved constructor. Load errors are caught and logged but no longer prevent rendering.Macroscope summarized f44f1a5.
Note
Medium Risk
Changes when desktop auth/UI mount relative to the remote Clerk UI bundle; core Clerk instance and fetch proxy are unchanged, but sign-in UI may stay unavailable if the script fails.
Overview
Desktop no longer blocks on the optional Clerk UI script.
DesktopClerkProviderused to returnnulluntilloadDesktopClerkUifinished, so a slow or failed UI bundle from Clerk’s CDN prevented the router and rest of the app from mounting.The provider now builds a thenable via
useMemoand passes it toInternalClerkProvider’sui.ClerkUIprop so Clerk can mount auth context immediately while the UI bundle loads in the background. Load failures are still surfaced withconsole.errorin auseEffectcatch, but children render either way.Reviewed by Cursor Bugbot for commit f44f1a5. Bugbot is set up for automated code reviews on this repo. Configure here.