Repository navigation
fix(web): stop settings subscribers from hanging startup - #196
Conversation
Model: GPT-6 Task: CLO-1167 desktop startup repair Agent: Codex Lane: codex
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Independent review (Claude Code), head I reached the same root cause separately, from the installed app ( What I checked in the diff:
No findings. Ready to merge once ARC CI is green. |
What broke
Since the desktop release built from
c363c6e(release/native-0.1.10), T3 Code freezes on startup and never finishes loading. On the founder laptop the renderer's memory climbs to 2–4 GB within about a minute of the page loading (the old release3ad1bfdpeaked around 0.6 GB on the same data). The 7 GB machine starts swapping, and the renderer crashes with exit code 133 (V8 out of memory), then reloads and does it again. Owning ticket: the T3 desktop startup failure (CLO-1167).Root cause
viewerFounderAtom(added in #157, "show who spoke and keep each founder's place") subscribes to client settings and callsget.refreshSelf()from the listener. Refreshing disposes the atom's lifetime, which unsubscribes the old listener, and the rebuild subscribes a new one. Both settings emitters iterated their liveSet, and Set iteration visits entries appended during the loop. So when hydration calls the settings setter, the emitter sees each new listener, refreshes again, and keeps going forever.Evidence from the live installed app: with the debugger attached to the busy renderer, 10 of 10 pause samples landed in this loop:
Fix
Both emitters now loop over a snapshot of the listeners taken when the notification starts, and skip any listener removed during the loop. Effect atom lifetimes already no-op
refreshSelf/setSelfafter disposal, so calling a stale listener would be harmless anyway; thehascheck just avoids the extra call.Verification
apps/web/src/hooks/useSettings.test.ts: 14 of 14 pass (re-run independently on this head). Both new regressions failed before the patch.Deploy: fleet
🤖 Generated with Claude Code