1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-07-24 10:56:59 +00:00

Prevent update downgrade from stable

This commit is contained in:
Michael Hollister 2024-11-21 13:11:19 -06:00
parent d79417a4e4
commit 4af2a537ef
2 changed files with 9 additions and 6 deletions

View file

@ -326,7 +326,7 @@ export class Updater {
const localChannelVersion: number = Updater.localPackageJson.channelVersion ? Updater.localPackageJson.channelVersion : 0;
const currentChannelVersion: number = Updater.releasesJson.channelCurrentVersions[Updater.updateChannel] ? Updater.releasesJson.channelCurrentVersions[Updater.updateChannel] : 0;
logger.info('Update check', {
channel: Updater.updateChannel,
updateChannel: Updater.updateChannel,
channel_version: localChannelVersion,
localVersion: Updater.localPackageJson.version,
currentVersion: Updater.releasesJson.currentVersion,
@ -340,7 +340,10 @@ export class Updater {
// Allow for update promotion to stable, while still getting updates from the subscribed channel
const newCommit = (Updater.updateChannel !== 'stable' && Updater.localPackageJson.commit !== Updater.releasesJson.currentCommit);
if (newVersion || newChannelVersion || newCommit) {
// Prevent downgrading to sub channel if on stable
const isDowngrade = Updater.releaseChannel === 'stable' && newChannelVersion;
if ((newVersion || newChannelVersion || newCommit) && !isDowngrade) {
logger.info('Update available...');
return true;
}