fix: don't show onboarding when server is unreachable#8312
fix: don't show onboarding when server is unreachable#8312jeffa-block wants to merge 2 commits intoblock:mainfrom
Conversation
When goosed is down, OnboardingGuard's config read fails and falls through to setHasProvider(false), showing the Welcome screen to existing users. This is confusing — they think they need to reconfigure. Fix: persist a localStorage flag on successful provider detection. On config read failure, check the flag before falling through to onboarding. Existing users see the error screen instead of Welcome.
Tests the three key paths: - Provider detected → localStorage flag set, children rendered - Config read fails + flag exists → existing user sees children (not onboarding) - Config read fails + no flag → new user sees Welcome screen Includes a localStorage shim for the jsdom environment (getItem/setItem are undefined in this repo's test setup).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff63960396
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (configured) { | ||
| localStorage.setItem('goose_has_provider', 'true'); | ||
| } |
There was a problem hiding this comment.
Clear cached provider flag when config is empty
goose_has_provider is only ever written to 'true' and never removed when GOOSE_PROVIDER becomes empty, so the cache can go stale. A user can reset provider config (see ResetProviderSection removing GOOSE_PROVIDER) and still retain this flag; if read() later fails (for example, goosed is unreachable), the catch path treats them as configured and skips onboarding even though no provider is configured. Clear or remove the localStorage flag when configured is false to keep fallback behavior aligned with current config.
Useful? React with 👍 / 👎.
When
readConfigfails (goosed down),OnboardingGuardfalls through tosetHasProvider(false), showing the Welcome screen to existing users. This is confusing — they think they need to reconfigure.Fix: Persist a
localStorageflag (goose_has_provider) on successful provider detection. On config read failure, check the flag before falling through to onboarding. Existing users see the error screen instead of Welcome.Fixes #8311 (PR 1 of 2)
Changes
Testing
/→ see error screen, NOT Welcomepnpm vitest run src/components/onboarding/OnboardingGuard.test.tsx→ 6/6 pass