You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[P1/bug] Effect re-triggers checkForUpdates on every updateStatus flip to idle #346
The effect fires whenever updateStatus === "idle". Any state transition that sets updateStatus: "idle" (e.g., a future "dismiss" action, or a hot-reload that resets the store) immediately re-triggers the check. The checkForUpdates function (settingsStore.ts:140-167) calls await check() which is a network call to GitHub. Combined with HMR (hot module reload in dev re-mounts components), each idle reset triggers a GitHub request.
Files
src/components/layout/StatusBar.tsx:77-79
Expected
Rapid state transitions that set updateStatus: "idle" only trigger 1 network call per minute; the manual "Check for updates" button bypasses the dedup.
Proposed fix
Scope S — track a module-level lastCheckAt timestamp; only re-trigger if Date.now() - lastCheckAt > 60_000 (1 minute) or if the user explicitly clicks the "Check for updates" button. Add the dedup check inside checkForUpdates or before the call.
Acceptance
Rapid state transitions that set updateStatus: "idle" only trigger 1 network call per minute; the manual "Check for updates" button bypasses the dedup.
Activity