Skip to content

fix(desktop): reject stale updates and improve update UX - #1205

Draft
skevetter wants to merge 8 commits into
mainfrom
devsy-1187-update-ux-focused-plan
Draft

fix(desktop): reject stale updates and improve update UX#1205
skevetter wants to merge 8 commits into
mainfrom
devsy-1187-update-ux-focused-plan

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

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

  • Candidate Validation & Downgrade Safety:
    • Adds an explicit semver dependency in desktop/package.json.
    • Implements classifyCandidate(currentVersion, candidateVersion) to classify update candidates into newer, same, older, and invalid.
    • Configures autoUpdater to explicitly enforce allowDowngrade = false across channel transitions.
    • Rejects older, equal, or malformed candidates in update-available, cancels automatic download for rejected candidates, and sets state to up-to-date.
    • Guards downloadUpdate() and installUpdate() against unauthorized transitions.
  • Explicit Version State Contract:
    • Refactors UpdateStatus into a discriminated union separating currentVersion and availableVersion.
    • Preserves candidate versions across available -> downloading -> downloaded.
    • Adopts affirmative state: "up-to-date".
  • Updates UI Redesign:
    • Redesigns UpdatesPanel.svelte status hero with affirmative Devsy is up to date resting state, visible installed version, channel, and last check timestamp.
    • Displays distinct Installed, Available, and Channel breakdown when updates exist.
    • Handles idle, dev-mode, and channel-missing states cleanly.
    • Uses single-word action labels (Download update, Restart, Try again) without ampersands.
    • Aligns UpdateDialog.svelte to match panel states and copy.
  • Notifications & Diagnostics:
    • Updates tray menu to show Update to <version> or Restart.
    • Silences background up-to-date check toasts while providing success toasts on user-initiated checks.
    • Resets userInitiated state when candidates become available.
    • Adds structured diagnostic logs in updater.ts tracking current, feed, available, channel, and result.
  • Tests:
    • Regression tests for [Bug]: AppImage 1.17.0 says version 1.16.2 is available #1187 (v1.17.0 current vs v1.16.2 remote), equal versions, patch/minor increments, preview progression, and preview-to-stable transitions.
    • Guard tests for download and install transitions.
    • UI state and toast notification unit tests.

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).

- 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
@netlify

netlify Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 5fb1142
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a9fb4f4a0214d0008878f4f

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 5fb1142
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a9fb4f4a3d0080008b40354

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AppImage 1.17.0 says version 1.16.2 is available

1 participant