Skip to content

[P0/bug] installUpdate calls relaunch() unconditionally — no confirmation, no 'later' option #344

Closed

Description

@EVWorth

Context

settingsStore.ts:178-198 (installUpdate); specifically lines 195-198: set({ updateStatus: "downloaded" }); await relaunch();.

Problem

On any machine where downloadAndInstall succeeds but the user has unsaved work (the dialog is open, an editor tab is dirty, a long-running query is in flight), relaunch() immediately kills the process. The StatusBar.tsx code paths that prevent relaunch in the "available" state (lines 165-178) check isExecuting and hasDirtyTabs BEFORE the install starts — but they don't prevent the install from starting in the first place if the user navigates the dialog and clicks Install. Once installUpdate is called, the relaunch is unconditional. The order is also fragile: set({ updateStatus: "downloaded" }) then await relaunch() — the relaunch will throw if it can't kill the process (e.g., user denies OS-level permission), and the catch path sets updateStatus: "error" — but the OS has already started the install. The user is now in an inconsistent state where the install may have started but the UI says "error".

Files

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

Expected

Clicking the update chip downloads the update, then a confirmation dialog appears; clicking Restart Now relaunches; clicking Restart Later preserves the install and prompts on next launch.

Proposed fix

Scope M — (a) re-check isExecuting and hasDirtyTabs at the moment of relaunch(); (b) ask for a confirmation dialog before triggering relaunch: "Update downloaded. Restart SQLPilot now to apply?" with Cancel and "Restart Now" buttons; (c) add a "Restart Later" option that defers the relaunch to app exit.

Acceptance

Clicking the update chip downloads the update, then a confirmation dialog appears; clicking Restart Now relaunches; clicking Restart Later preserves the install and prompts on next launch.

Needs human verify

yes

Activity

  1. added
    audit
    severity/p0
    kind/bug
    area/theming
    on Jul 31, 2026
  2. added a commit that references this issue on Sep 8, 2026
    6ecba3b
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/p0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions