fix(update): enable allowPrerelease on the nightly channel (#2265)

Nightly builds publish as GitHub prereleases. configureFeed set channel
and allowDowngrade but never allowPrerelease, which defaults to false, so
electron-updater only inspected the latest NON-prerelease release
(e.g. v0.10.0) and 404d looking for nightly-mac.yml there. The nightly
channel therefore never resolved, regardless of whether a nightly was
published.

Set allowPrerelease = (channel === nightly): nightly scans prereleases
and finds the nightly feed; stable stays on non-prereleases only.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Harshit Singh Bhandari 2026-06-29 03:37:49 +05:30 committed by GitHub
parent 965e388792
commit 6b56b1c245
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,11 @@ import {
// checkForUpdates. // checkForUpdates.
function configureFeed(channel: UpdateChannel): void { function configureFeed(channel: UpdateChannel): void {
autoUpdater.channel = channel; // "latest" | "nightly" autoUpdater.channel = channel; // "latest" | "nightly"
// Nightly builds ship as GitHub *prereleases*. With allowPrerelease false
// (the default) electron-updater only inspects the latest NON-prerelease
// release and looks for nightly-mac.yml there, which 404s. Enable prerelease
// scanning on the nightly channel only; stable must never pull prereleases.
autoUpdater.allowPrerelease = channel === "nightly";
autoUpdater.allowDowngrade = true; // permits a nightly -> stable channel switch autoUpdater.allowDowngrade = true; // permits a nightly -> stable channel switch
} }