Frontend SPA crashes on boot with React #185 (max update depth) — object-returning Zustand selector in AuthInitializer; UI never renders #49
Labels
No labels
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-fetch
blocked:lint-failed
blocked:needs-decision
blocked:no-changes
blocked:no-procedure
blocked:verify-failed
bug
feature-request
in-progress
needs-decompose
needs-triage
ops-task
quickfix
security/high
security/low
security/medium
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/docker_backup#49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
The deployed SPA crashes on boot before rendering anything — the root element stays empty and no login form ever appears. This blocks the entire UI, including the Settings page's encryption-at-rest controls ("Encrypt backups at rest" Switch + Encryption Key input).
Root cause
src/main.tsx:14-15:This is an object-returning Zustand selector: it returns a fresh object on every call, so
logoutgets a new reference on every store update. It is used in auseEffectdependency array atsrc/main.tsx:33([restoreSession, logout]), so the effect re-runs on every store update → store update → infinite effect/render loop → React error #185 (Maximum update depth exceeded).Reproduction (from kanban QA card t_3b5379e0, zsus)
docker_backup-appbuilt from HEAD7dd94b8(served bundleindex-CJpvs0MX.js, md5fb5d3695482d02d656ca54010a64a3b8).http://127.0.0.1:3000in a browser.Actual vs expected
Settings.tsx:324-351renders them, and the settings API round-tripsencryptionEnabled/encryptionKey).Impact
This blocked acceptance criterion "UI shows encryption controls" for the encryption-at-rest E2E verification. The backup→
.encAES-GCM ciphertext and restore→byte-identical-payload criteria were verified at the API level; the UI criterion cannot be demonstrated until this is fixed. Screenshot of the blank/loginpage is attached to kanban card t_3b5379e0.Fix direction
Use a primitive selector so the reference is stable:
useAuthStore(s => s.logout)or wrap the object selector inuseShallow. Then rebuild the frontend image and redeploy on zsus.References
src/main.tsx:14-15,src/main.tsx:33