Repository navigation
fix(desktop): disable the updater when app-update.yml is missing - #64681
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Looks good. I couldn't package the app from source in time, so I patched this PR's app-update.yml check into the official v2.3.2 Linux .deb and ran it headless. With the file removed, the startup check no longer logs the ENOENT error or goes into error. With the file present, the updater still checks and ends up up-to-date. bun test src/updater and tsc -b pass in packages/gui-plugins. Public API: unchanged.
The Settings and toast changes are visible in the UI, but I couldn't capture them. Could you add a before/after screenshot of Settings → Updates on a build without app-update.yml?
Related: #52122
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #64649
Type of change
What does this PR do?
The desktop updater turned on for any packaged build. electron-updater reads its feed from
resources/app-update.yml, and distro packages that update the app themselves remove it (the AUR'sopencode-desktop-bindoes). Every check then failed with a rawENOENTtoast, and the background check logged the error at startup and every 10 minutes.The updater now also needs
app-update.ymlto be present before it turns on. Without it, the updater stays in its existingdisabledstate, so electron-updater never loads. It logs once that it's disabled, and the app menu's "Check for Updates…" item is greyed out. Official builds are unaffected. electron-builder writesapp-update.ymlintoresourcesfor its auto-updatable targets (dmg/zip, NSIS, AppImage, deb, rpm),script/pack.tswrites it for--dirbuilds, and the official.debships it. A missing file is how packagers turn the updater off: an electron-builder maintainer recommends deleting it to disable auto-update for deb/rpm (electron-builder#8838). electron-updater 6.8.9's ownisUpdaterActive()only checksapp.isPackaged(plusAPPIMAGEfor AppImage), so it can't tell us this.In Settings, the button for a
disabledupdater now reads "Updates unavailable", and the row says the build is updated outside OpenCode. A check that comes backdisabled(for example the hiddencheckcommand) shows the same message in a toast instead of nothing. The new strings are in English only; other locales fall back to them.No feature flag: this is a bug fix.
How did you verify your code works?
bun test src/updaterandbun typecheckinpackages/gui-plugins.updaterActionreports thedisabledstate as unavailable.Screenshots / recordings
None.
Checklist