fix(auto-updater): throw error on update check failure instead of returning result.#1213
fix(auto-updater): throw error on update check failure instead of returning result.#1213leozhang2018 wants to merge 4 commits into
Conversation
|
| Filename | Overview |
|---|---|
| packages/desktop/src/features/auto-updater.ts | Catch block changed from returning synthetic "no update" result to rethrowing the error — a minimal, targeted fix for the silent-failure bug. |
| packages/desktop/src/features/auto-updater.test.ts | Restructures mocks to use vi.hoisted so they can be referenced in vi.mock factories, and adds a new test asserting checkForAppUpdate rejects on updater failure. |
Sequence Diagram
sequenceDiagram
participant Renderer
participant DaemonManager
participant checkForAppUpdate
participant electronUpdater as electron-updater
Renderer->>DaemonManager: check_app_update (IPC)
DaemonManager->>checkForAppUpdate: checkForAppUpdate(...)
checkForAppUpdate->>electronUpdater: autoUpdater.checkForUpdates()
alt updater succeeds
electronUpdater-->>checkForAppUpdate: UpdateCheckResult
checkForAppUpdate-->>DaemonManager: AppUpdateCheckResult
DaemonManager-->>Renderer: "{ hasUpdate, ... }"
else updater throws (network / manifest failure)
electronUpdater--xcheckForAppUpdate: throws Error
Note over checkForAppUpdate: console.error(...) then rethrow
checkForAppUpdate--xDaemonManager: throws Error
DaemonManager--xRenderer: IPC error
Note over Renderer: Renderer error handler shows check failed
end
Reviews (5): Last reviewed commit: "Merge branch 'main' into main" | Re-trigger Greptile
…urning result. Signed-off-by: leozhang2018 <leozhang2018@gmail.com>
Signed-off-by: leozhang2018 <leozhang2018@gmail.com>
Type of change
What does this PR do
Fixes desktop update checks reporting updater failures as “up to date.”
Previously, when
electron-updater.checkForUpdates()failed, for example because the network was unavailable or the GitHub update manifest could not be fetched/parsed, the desktop main process caught the error and returned a normal “no update” result. That caused the renderer to showApp is up to date.even though the check had failed.This PR rethrows the updater check error after logging it, allowing the existing renderer error handling to show the update check as failed for manual checks. Silent background checks still only warn and preserve the current state.