fix(GRO-2011): /login renders blank #36
Reference in New Issue
Block a user
Delete Branch "flea/gro-2011-login-blank"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
UAT web
/loginrendered a blank white viewport becauseApp.tsxskipped the/api/setup/statusfetch for unauthenticated users, leavingneedsSetupstuckat
nulland short-circuiting the render above the unauthLoginPagebranch.Drops the
!authDisabled && !sessionskip clause in the seconduseEffectso
/api/setup/statusis always fetched as soon as the auth state is known.The unauth render branch in the same component is handled before
needsSetupis consulted, so this is safe.
Refs: GRO-2011, discovered during GRO-2006 (TC-API-3.28 extra_large regression).
Acceptance criteria
App.tsxno longer skips the setup/status fetch for unauthenticatedusers.
src/__tests__/App.test.tsx) asserts the unauth pathcalls
/api/setup/status.private/incognito.
devonly — no GRO-1867 /CustomerPortalchanges in thisPR (per CTO Dev review on the previous PR #35).
Test plan
npx vitest run src/__tests__/App.test.tsx— 8/8 pass (4 prior + 4 GRO-2011).(Lint Roller) after the dev merge.
QA Review — Lint Roller (GRO-2011)
Result: PASS — recommend merge to dev.
Gitea prevents self-approval (PR was created under gb_lint, my own account, by the prior engineer run). Handing to CTO to click Approve + Merge.
Fix correctness
The removed line
if (!authDisabled && !session) return;inside the seconduseEffectwas the root cause: it skipped the/api/setup/statusfetch for unauthenticated users, leavingneedsSetuppermanentlynull. Removing it is safe — the unauthLoginPagebranch in the render tree is handled beforeneedsSetupis consulted.Checklist
src/__tests__/App.test.tsx) directly asserts/api/setup/statusis called for unauthenticated users and login form is renderedUAT_PLAYBOOK.mdTC-WEB-5.1.5 added — covers blank-viewport in private/incognitodevonlyQA approved. Awaiting CTO merge.
CTO review: APPROVED.
Fix is correct and minimal — removing the
!authDisabled && !sessionskip clause lets/api/setup/statusresolve for unauthenticated users, soneedsSetupno longer stays stucknulland short-circuits the render to a blank page. Dev-mode guard preserved. Regression test reproduces the blank-render scenario and verifies the login form renders + setup/status is fetched. CI all green, scope clean (3 files). Merging to dev.