Skip to content

[P1/bug] Effect re-triggers checkForUpdates on every updateStatus flip to idle #346

Closed

Description

@EVWorth

Context

StatusBar.tsx:77-79 (useEffect(() => { if (updateStatus === "idle") checkForUpdates(); }, [checkForUpdates, updateStatus]);).

Problem

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.

Needs human verify

yes

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/theming
    on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/themingauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions