Skip to content

Commit 60e4b33

Browse files
committed
feat(desktop): poll for updates every 4 hours while running
Boot-time check alone left idle sessions stuck on outdated builds. Add a recurring interval check; the existing update-downloaded dialog still drives the actual restart.
1 parent 65207f7 commit 60e4b33

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@executor-js/desktop": patch
3+
"executor": patch
4+
---
5+
6+
Desktop now re-checks for updates every 4 hours while running. Previously
7+
the only update check was at app launch, so a long-running session would
8+
sit on an outdated build indefinitely until the user quit and relaunched.
9+
The interval is a self-heal — once an update is downloaded, the existing
10+
"Update ready" dialog drives the rest of the flow.

apps/desktop/src/main/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ const promptInstallUpdate = async (version: string) => {
302302
}
303303
};
304304

305+
// Re-check periodically so a long-running session picks up releases
306+
// without requiring a quit + relaunch. The boot-time check still runs;
307+
// this interval is purely a self-heal for idle apps.
308+
const UPDATE_POLL_INTERVAL_MS = 4 * 60 * 60 * 1000; // 4 hours
309+
305310
const setupAutoUpdater = () => {
306311
if (!app.isPackaged) return;
307312
autoUpdater.logger = log;
@@ -315,6 +320,11 @@ const setupAutoUpdater = () => {
315320
autoUpdater.on("error", (err: Error) => {
316321
log.warn("[updater] error", err);
317322
});
323+
324+
setInterval(() => {
325+
if (downloadedUpdateVersion) return; // already staged; waiting on the user
326+
void runUpdateCheck({ alertOnFail: false });
327+
}, UPDATE_POLL_INTERVAL_MS);
318328
};
319329

320330
interface UpdateCheckOptions {

0 commit comments

Comments
 (0)