Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions apps/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,8 @@ function createBaseUpdateState(
function applyAutoUpdaterChannel(channel: DesktopUpdateChannel): void {
autoUpdater.channel = channel;
autoUpdater.allowPrerelease = channel === "nightly";
autoUpdater.allowDowngrade = channel === "nightly";
console.info(
`[desktop-updater] Using update channel '${channel}' (allowPrerelease=${channel === "nightly"}, allowDowngrade=${channel === "nightly"}).`,
`[desktop-updater] Using update channel '${channel}' (allowPrerelease=${channel === "nightly"}, allowDowngrade=${autoUpdater.allowDowngrade}).`,
);
}

Expand Down Expand Up @@ -1813,14 +1812,7 @@ function registerIpcHandlers(): void {
}

applyAutoUpdaterChannel(nextChannel);
const allowDowngrade = autoUpdater.allowDowngrade;
// An explicit channel switch should allow the immediate nightly->stable rollback path.
autoUpdater.allowDowngrade = true;
try {
await checkForUpdates("channel-change");
} finally {
autoUpdater.allowDowngrade = allowDowngrade;
}
await checkForUpdates("channel-change");
return updateState;
});

Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/src/updateChannels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ describe("doesVersionMatchDesktopUpdateChannel", () => {
it("rejects nightly releases on the stable channel", () => {
expect(doesVersionMatchDesktopUpdateChannel("0.0.17-nightly.20260416.1", "latest")).toBe(false);
});

it("accepts stable releases on the stable channel", () => {
expect(doesVersionMatchDesktopUpdateChannel("0.0.17", "latest")).toBe(true);
});
});
Loading