From 865d7bd6849de306932bbffabd3a06075313dbc4 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Tue, 3 Mar 2026 20:40:20 -0800 Subject: [PATCH] Guard update install while app is quitting - Prevent update install from running when shutdown is already in progress - Ignore install IPC calls once `isQuitting` is set to avoid duplicate install attempts --- apps/desktop/src/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index 22948e23dc06672f81d027bdcb166641c4cca1a8..be36b10cd485cdf103daa424f7c1d4aacbd3c18f 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -641,7 +641,7 @@ async function downloadAvailableUpdate(): Promise { } function installDownloadedUpdate(): void { - if (!updaterConfigured || updateState.status !== "downloaded") return; + if (isQuitting || !updaterConfigured || updateState.status !== "downloaded") return; isQuitting = true; clearUpdatePollTimer(); @@ -1030,6 +1030,7 @@ function registerIpcHandlers(): void { ipcMain.removeHandler(UPDATE_INSTALL_CHANNEL); ipcMain.handle(UPDATE_INSTALL_CHANNEL, async () => { + if (isQuitting) return; installDownloadedUpdate(); }); } -- 2.54.0