feat(desktop): in-app Check for Updates / Update Now in Settings - #128
Merged
Conversation
The desktop app already runs electron-updater, but the only way to check was the app-menu dialog flow — Settings itself only showed a toggle and a static version number. Adds a renderer-facing status channel (updater.mjs → trusted IPC → preload → SettingsView) so Settings can show live check/download/install progress and offer "Check for Updates" / "Update Now" inline, without touching the existing menu-driven dialogs. Live/browser mode gets a lighter parallel: a manual GitHub-releases check with a link to the new release, since there's nothing to install there. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: John Siracusa <siracusa5@users.noreply.github.com>
Two independent adversarial reviews of PR #128 flagged that installNow() called autoUpdater.quitAndInstall() with zero confirmation, unlike the existing menu-driven checkInteractive() dialog flow it sits beside — an instant, unprompted quit for a genuinely trusted user clicking the button, and an unconfirmed way for any script running in a trusted renderer to force the app to quit. Adds the same native "Relaunch to Update" / "Cancel" dialog checkInteractive() already uses. Everything else both reviews raised (status races, missing rate limits, role scoping) was judged pre-existing risk, out of scope, or too low-probability to be worth the added complexity. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: John Siracusa <siracusa5@users.noreply.github.com>
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.
Summary
electron-updater, and an "Update Now" button once a download completes — previously the only way to trigger a check was the app-menu dialog flow, and Settings showed just a toggle plus a static version number.apps/desktop/src/main/updater.mjsforwardsautoUpdaterevents (checking-for-update/update-available/download-progress/update-downloaded/error) through trusted IPC (updates:get-status/updates:check/updates:install, both windows) towindow.__CC_DESKTOP.updatesin the preload bridge. Additive — the menu's dialog-drivencheckInteractive()is untouched and drives the sameautoUpdatersingleton.checkForUpdate(..., { force: true }), bypassing the session cacheUpdatePillrelies on) with a link to the new release, since there's nothing to install in a browser. Demo mode shows nothing, matching the existingUpdatePillgating.Affected area
apps/desktop)Validation
npm test(root)npm --prefix apps/console run typechecknpm --prefix apps/console test(428 passed, incl. new coverage for both the desktop bridge flow and the browser manual-check flow)npm --prefix apps/console run buildnpm --prefix apps/site run buildapps/desktop:npm test(104 passed),npm run test:navigation,npm run test:cli-statusapps/desktop:npm run smoke— blocked locally by the already-running packaged/Applications/ContextCake.appholding the single-instance lock (shareduserDatapath); relying on CI's clean runner for this one, will watch the required desktop CI job.Compatibility
Sign-off
git commit -s) per theDeveloper Certificate of Origin.