fix: enable background update checks in dev builds

Remove the isPackaged guard from AutoUpdateService.start() so that
background update checks run in both packaged and dev builds.
forceDevUpdateConfig already handles dev-mode config correctly via
dev-app-update.yml — the start() gate was preventing the 10s initial
check and 4h periodic checks from ever being scheduled in dev.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-30 17:18:02 +02:00
co-authored by Copilot
parent 772c84fed3
commit 535adc64be
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -192,7 +192,7 @@ export class AutoUpdateService {
}
start(): void {
if (this.started || !this.options.isPackaged) {
if (this.started) {
return;
}
+6 -4
View File
@@ -64,18 +64,20 @@ class FakeScheduler implements AutoUpdateScheduler {
}
describe('AutoUpdateService', () => {
test('does not schedule checks for unpackaged apps but manual checks still work', async () => {
test('schedules checks for unpackaged apps using dev update config', async () => {
const updater = new FakeUpdater();
const scheduler = new FakeScheduler();
const service = new AutoUpdateService({ isPackaged: false, scheduler, updater });
service.start();
expect(scheduler.timeouts).toHaveLength(0);
expect(scheduler.intervals).toHaveLength(0);
expect(updater.forceDevUpdateConfig).toBe(true);
expect(scheduler.timeouts).toEqual([{ callback: expect.any(Function), delayMs: 10_000 }]);
expect(scheduler.intervals).toEqual([{ callback: expect.any(Function), delayMs: 4 * 60 * 60 * 1000 }]);
await scheduler.runTimeout();
await Promise.resolve();
await service.checkForUpdates();
expect(updater.checkForUpdatesCalls).toBe(1);
});