fix(desktop): reject stale updates and improve update UX - #1205
Draft
skevetter wants to merge 8 commits into
Draft
fix(desktop): reject stale updates and improve update UX#1205skevetter wants to merge 8 commits into
skevetter wants to merge 8 commits into
Conversation
- add semver candidate classification policy - explicitly enforce allowDowngrade = false across channel configurations - reject update-available candidates that are not newer than installed version - guard downloadUpdate and installUpdate transitions - add regression tests for #1187 and channel switches
- distinguish currentVersion and availableVersion in UpdateStatus - use up-to-date state across updater and renderer - preserve candidate version across download lifecycle - update IPC types and renderer stores for explicit version state
- redesign UpdatesPanel status hero with calm affirmative up-to-date state - display separate installed and available versions when updates exist - update downloaded state to use 'Restart & update' CTA - update UpdateDialog to reflect new states and copy
- align tray menu with 'Restart & Update to <version>' copy - refine update toasts to use 'Restart & update' action and affirmative up-to-date copy - add structured diagnostics logging for update check and download decisions - add unit tests for toasts and structured diagnostics
- replace ampersands in update actions with single words - use 'Restart' in panel, dialog, and toast actions - use 'Update to <version>' or 'Restart' in tray menu
- replace _allowPrerelease and _channel with module-scoped state variables
- cancel autoDownload on rejected candidates and guard download handlers - handle idle, dev-mode, and channel-missing states in UpdatesPanel - reset userInitiated flag when update is available - add tests for rejected download cancellation, idle/code states, and toasts
✅ Deploy Preview for images-devsy-sh canceled.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
✅ Deploy Preview for devsydev canceled.
|
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.
Resolves #1187
Summary
Hardens the desktop auto-updater against stale update manifests and unexpected downgrades, and redesigns the update state and user experience.
Key Changes
semverdependency indesktop/package.json.classifyCandidate(currentVersion, candidateVersion)to classify update candidates intonewer,same,older, andinvalid.autoUpdaterto explicitly enforceallowDowngrade = falseacross channel transitions.update-available, cancels automatic download for rejected candidates, and sets state toup-to-date.downloadUpdate()andinstallUpdate()against unauthorized transitions.UpdateStatusinto a discriminated union separatingcurrentVersionandavailableVersion.available->downloading->downloaded.state: "up-to-date".UpdatesPanel.sveltestatus hero with affirmativeDevsy is up to dateresting state, visible installed version, channel, and last check timestamp.Installed,Available, andChannelbreakdown when updates exist.idle,dev-mode, andchannel-missingstates cleanly.Download update,Restart,Try again) without ampersands.UpdateDialog.svelteto match panel states and copy.Update to <version>orRestart.up-to-datecheck toasts while providing success toasts on user-initiated checks.userInitiatedstate when candidates become available.updater.tstrackingcurrent,feed,available,channel, andresult.Verification
npm run check(svelte-check): 4874 files, 0 errors, 0 warnings.npm run test(vitest): 38 test files passed (351 passed tests).coderabbit review --base main: clean (0 findings).