fix: allow downgrade from nightly to stable by not overriding autoUpdater.allowDowngrade#2460
fix: allow downgrade from nightly to stable by not overriding autoUpdater.allowDowngrade#2460shoaib050326 wants to merge 1 commit intopingdotgg:mainfrom
Conversation
…ater.allowDowngrade Removes the explicit allowDowngrade = false override for the stable channel in applyAutoUpdaterChannel that prevented electron-updater from finding older stable releases as valid downgrades from nightly. Also simplifies the redundant allowDowngrade save/restore toggle since the autoUpdater.channel setter already defaults allowDowngrade = true. Adds missing test for stable versions accepted on the stable channel. Closes pingdotgg#2340
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR modifies the desktop app's auto-update downgrade behavior by removing explicit control of You can customize Macroscope's approvability policy. Learn more. |
Summary
allowDowngrade = falseoverride for the stableupdate channel that prevented electron-updater from finding older
stable releases as valid downgrades from nightly builds.
allowDowngradesave/restore toggle aroundthe channel-switch update check, since
applyAutoUpdaterChannelnow correctly preserves the channel setter's default
true.channel.
Root cause
applyAutoUpdaterChannelsetautoUpdater.channel = channel(whichelectron-updater auto-follows with
allowDowngrade = true), thenimmediately overrode it to
channel === "nightly". For the"latest"channel this forced
allowDowngrade = false, blocking any stabledowngrade after a nightly install.
Risk
Low. The channel setter's
allowDowngrade = truedefault is thedocumented electron-updater behavior and is appropriate for both
channels. No other
allowDowngradeassignments exist in the codebase.Rollback
Revert this commit. No data migration needed.
Closes #2340
Note
Medium Risk
Changes Electron auto-update channel switching behavior, which can affect which releases are considered valid and how clients update/rollback. Risk is limited in scope but could impact update eligibility if electron-updater defaults differ across platforms.
Overview
Desktop auto-updater channel switching now preserves
electron-updater’sallowDowngradebehavior instead of forcing it based on channel, enabling nightly installs to roll back to stable releases.This removes the temporary
allowDowngradetoggle around the channel-change update check and updates logging to report the effectiveautoUpdater.allowDowngrade. Adds a test to ensure stable versions are accepted on thelatestchannel.Reviewed by Cursor Bugbot for commit 7f300a8. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix downgrade from nightly to stable by preserving
autoUpdater.allowDowngradePreviously,
applyAutoUpdaterChannelin main.ts overrodeautoUpdater.allowDowngradebased on the selected channel, and theSET_CLIENT_SETTINGS_CHANNELhandler temporarily forced it totrueduring channel-change update checks. This prevented stable versions from being installed when downgrading from nightly.applyAutoUpdaterChannelno longer setsallowDowngrade; it only setschannelandallowPrereleaseSET_CLIENT_SETTINGS_CHANNELhandler callscheckForUpdates('channel-change')directly without modifyingallowDowngradeMacroscope summarized 7f300a8.