Skip to content

[P1/bug] pendingUpdate can be replaced by concurrent checkForUpdates — version mismatch #347

Closed

Description

@EVWorth

Context

settingsStore.ts:178-198 (installUpdate: const cached = useSettingsStore.getState().pendingUpdate; if (!cached) return; await cached.downloadAndInstall(...)).

Problem

The function reads pendingUpdate from the store state at the moment install starts. If checkForUpdates is re-invoked between the user clicking Install and the download starting (e.g., the 60-second auto-refresh in F4), pendingUpdate could be a different Update object. The download-then-install is then for a different version than the user saw. The tauri-plugin-updater Update object is opaque (internal API), so the user has no way to verify which version is being installed.

Files

  • src/stores/settingsStore.ts:178-198

Expected

A concurrent checkForUpdates during install doesn't change which version gets installed; the UI shows the version that was actually installed.

Proposed fix

Scope S — pin the Update to a local variable at the moment the user clicks Install; pass it explicitly to downloadAndInstall; re-validate the version against updateVersion state at the end before setting updateStatus: "downloaded".

Acceptance

A concurrent checkForUpdates during install doesn't change which version gets installed; the UI shows the version that was actually installed.

Needs human verify

yes

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/theming
    on Jul 31, 2026
  2. EVWorth commented on Sep 11, 2026

    @EVWorth
    OwnerAuthor

    Already fixed, in 6ecba3b ("separate downloading from restarting, and put the refusal in the action", #573).

    Covered in settingsStore.test.ts, which cites this issue number at the relevant assertions.

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