mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-24 13:38:43 +02:00
fix: enable update checks in dev mode via forceDevUpdateConfig
Add dev-app-update.yml so electron-updater can check GitHub releases even when running with bun run dev. Remove the isPackaged guard from checkForUpdates() so manual clicks always contact the update server. Automatic periodic checks remain disabled in dev mode. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
provider: github
|
||||
owner: davidkaya
|
||||
repo: aryx
|
||||
releaseType: release
|
||||
@@ -23,6 +23,7 @@ type AutoUpdateListener = (...args: any[]) => void;
|
||||
interface AutoUpdaterLike {
|
||||
autoDownload: boolean;
|
||||
autoInstallOnAppQuit: boolean;
|
||||
forceDevUpdateConfig: boolean;
|
||||
on(event: string, listener: AutoUpdateListener): this;
|
||||
removeListener(event: string, listener: AutoUpdateListener): this;
|
||||
checkForUpdates(): Promise<unknown>;
|
||||
@@ -180,6 +181,7 @@ export class AutoUpdateService {
|
||||
this.scheduler = options.scheduler ?? defaultScheduler;
|
||||
this.updater.autoDownload = true;
|
||||
this.updater.autoInstallOnAppQuit = false;
|
||||
this.updater.forceDevUpdateConfig = !options.isPackaged;
|
||||
|
||||
this.updater.on('checking-for-update', this.checkingListener);
|
||||
this.updater.on('update-available', this.availableListener);
|
||||
@@ -215,10 +217,6 @@ export class AutoUpdateService {
|
||||
}
|
||||
|
||||
async checkForUpdates(): Promise<UpdateStatus> {
|
||||
if (!this.options.isPackaged) {
|
||||
return this.getStatus();
|
||||
}
|
||||
|
||||
if (this.pendingCheck) {
|
||||
return this.pendingCheck;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ class FakeUpdater extends EventEmitter {
|
||||
|
||||
autoInstallOnAppQuit = true;
|
||||
|
||||
forceDevUpdateConfig = false;
|
||||
|
||||
checkForUpdatesCalls = 0;
|
||||
|
||||
quitAndInstallCalls = 0;
|
||||
@@ -62,7 +64,7 @@ class FakeScheduler implements AutoUpdateScheduler {
|
||||
}
|
||||
|
||||
describe('AutoUpdateService', () => {
|
||||
test('does not schedule checks for unpackaged apps', async () => {
|
||||
test('does not schedule checks for unpackaged apps but manual checks still work', async () => {
|
||||
const updater = new FakeUpdater();
|
||||
const scheduler = new FakeScheduler();
|
||||
const service = new AutoUpdateService({ isPackaged: false, scheduler, updater });
|
||||
@@ -71,8 +73,10 @@ describe('AutoUpdateService', () => {
|
||||
|
||||
expect(scheduler.timeouts).toHaveLength(0);
|
||||
expect(scheduler.intervals).toHaveLength(0);
|
||||
expect(await service.checkForUpdates()).toEqual({ state: 'idle' });
|
||||
expect(updater.checkForUpdatesCalls).toBe(0);
|
||||
expect(updater.forceDevUpdateConfig).toBe(true);
|
||||
|
||||
await service.checkForUpdates();
|
||||
expect(updater.checkForUpdatesCalls).toBe(1);
|
||||
});
|
||||
|
||||
test('configures auto download and schedules startup and periodic checks', async () => {
|
||||
|
||||
Reference in New Issue
Block a user