Repository navigation
fix(auth): a hung "Sign in with SSO" request gives the login page back after the 20 s sign-in watchdog - #35737
Conversation
…in watchdog window The SSO-by-email submit was a bare fetch with no signal, so a request that never answered left the button pending and the email field disabled. It now runs under an AbortController aborted after 20 s, the same window and sentence as the provider buttons' watchdog. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyy9KSA69EGZtjDj9c
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyy9KSA69EGZtjDj9c
|
repo:objectstack#7 · os-tesla · session_01L9qibyy9KSA69EGZtjDj9c Final head for review · 2026-11-20T04:49Z: |
|
repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH 席位核对L1: ACCEPT (L1-a, for area d7-A) at head Checklist (
|
|
repo:objectstack#7 · os-tesla · session_01L9qibyy9KSA69EGZtjDj9c Landing · 2026-11-20T04:52Z · head
State: ready + auto-merge now; #34861 closes on merge. |
Requested by Tesla · project thread
Fixes #34861
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/auth/src/LoginForm.tsx,handleSso: thePOST /api/v1/auth/sign-in/ssorequest now carries anAbortControllersignal, aborted afterSSO_SIGN_IN_TIMEOUT_MS(20 000 ms). On that abort the form showsSSO_SIGN_IN_TIMEOUT_TEXTand clearsssoSubmitting, so the SSO button and the SSO email field are usable again (retry path). The timer is cleared infinallyon every settle; a successful answer still navigates todata.urland keeps the pending state through teardown.SIGN_IN_TIMEOUT_MS/withTimeoutinsidesignInWithProviderincreateAuthClient.ts). They are module constants inLoginForm.tsx, not imported:createAuthClient.tsis outside this card's file surface, and the watchdog there is a local ofsignInWithProviderwith nothing exported to share.res.json()) is also under the signal: an abort during the body read surfaces as the timeout, not as the "No SSO provider" fallback.@object-ui/authpatch.Why
A hung SSO request left the button spinning and the email field disabled until a reload (reproduced by QA twice under SSO-only mode). The card's expected behaviour: "after about 20 s the watchdog recovers the button with an error and a retry path."
Tests
New top-level
describein the shared harnessui/packages/auth/src/__tests__/LoginForm.test.tsx(SSO-only mode, fakesetTimeout/clearTimeout):window.location.hrefto the IdP URL; after 20 s the signal is not aborted, the button keeps its pending state, and no alert shows.Readings at head 171e0ee (after merging origin/main a3a74f2)
pnpm --dir ui exec vitest run packages/auth/under the verify lock:Test Files 48 passed (48),Tests 493 passed (493), VERDICT command-exit 0.pnpm --filter @object-ui/auth type-check(tsc --noEmit && tsc -p tsconfig.test.json; the second program includessrc/**/*.test.tsx): VERDICT command-exit 0.../LoginFormfrom source, no dist in the path):node scripts/ablation-replace.mjsreplaced the timer bodycontroller.abort();/SSO_SIGN_IN_TIMEOUT_MSwith a no-op and a 1e9 ms delay (anchor x1 to x0, replacement x0 to x1, blob 990a9efa to 60b77598). Pin RED:expected false to be trueonsignal.aborted; CONTROL green. Restored: blob equals HEAD (990a9efa),git diff HEADempty.Acceptance notes
LoginForm.tsxmodule constants and the local insidesignInWithProvider). Moving the watchdog into one shared module is a follow-up for whoever next editscreateAuthClient.ts; not done here because that file was outside this card's surface.LoginFormLabelskey was added.onErroris not called on the SSO path, as before this change.Verification
Read first:
ui/packages/auth/src/LoginForm.tsxhandleSso(risk hunk: theres.json().catchrethrow on timeout and thefinallyclearing the timer, which must not fire after a successful navigation).Two-minute check:
pnpm --dir ui exec vitest run packages/auth/src/__tests__/LoginForm.test.tsx -t "aborted after 20 s"shows 2 passed.Local gate readings
node scripts/pm/dispatch-gates.mjs --commandsderived 38 families for this diff. 37 ran at head 171e0ee, all exit 0.--ranreconciliation: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED".pnpm --dir ui exec vitest run scripts/ran once at c00af54 (before the merge): exit 1, 2 files red of 173 (date-only-zone-pins-10183.test.ts, which drives other ui packages' zone tests, and a closure-budget test that needs a built Console bundle: "Budgeted chunkui-componentsis ABSENT from the eager closure"). Neither readsui/packages/auth. Read as an unbuilt-workspace reading, not a verdict, and left to CI'sTest UI.node scripts/pm/overlap-check.mjs --branch=HEADand--pr=35575: VERDICT clean exit 0.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses. (No formatter ran;pnpm lintis a repo-wide scan left to CI, not run locally.)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibyy9KSA69EGZtjDj9c