fix(web): keep the connecting splash and retry the first-load auth check - #1574
Conversation
🦋 Changeset detectedLatest commit: 08592d0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: faaa38d6c7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7702ea9b1
ℹ️ 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".
…th-gate # Conflicts: # apps/kimi-web/test/workspace-state.test.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 490593582a
ℹ️ 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".
…4xx auth fallback
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Related Issue
No linked issue — the problem is explained below (reported by users).
Problem
Right after starting or updating the web UI, the first visit lands on
/login; a manual refresh then loads the app normally.Root cause: the first
GET /api/v1/authfailing transiently (daemon still booting, config being rewritten by an upgrade, network blip, 5xx) was silently swallowed by the auth check, leavingauthReadyat its defaultfalse. The initial load then unconditionally marked itself initialized, so the auth gate (initialized && !authReady) rewrote the URL to/login— with no re-check anywhere, the page stayed there until a full reload.What changed
proceed(a definitive response, ready or not),retry(transient failure: network error, timeout, 5xx), andserver-auth-required(401 or envelope code 40101). The web bundle always ships paired with its daemon, so a daemon lacking this endpoint is out of scope by design./authbefore health/meta/models: a transient failure keeps the existing connecting splash up and retries/authevery 2s until it answers; a definitive answer proceeds exactly as before (ready:true→ app,ready:false→/login); a 401/40101 stops and hands over to the server-token dialog, which already reloads the page once the token is entered.App.vue: the token dialog flag now startsfalseand is only set by a real 401/40101 — previously it started from "no credential ⇒ prompt" and flashed the dialog for a frame in--dangerous-bypass-authmode before/metaarrived. The 401 listener is also registered before the initial load starts.ServerAuthDialog: z-index--z-modal→--z-max, so the prompt stays reachable above the connecting splash (--z-toast) when a 401 happens during first load.client.initializedtoo — it teleports to<body>and previously floated above the connecting splash (and its retry error) when the first load was still stuck.workspace-state.test.ts— transient failure keeps the splash and retries until success (first failure silent, error surfaced from the second); a definitiveready:falsestill initializes into the login gate; 401/40101 stops without retrying or initializing.Verified:
pnpm --filter @moonshot-ai/kimi-web test|typecheck|check:style|buildall pass; oxlint reports no new warnings on the touched files.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update (bug fix restoring the intended behavior; no documented behavior changes).