Skip to content

fix(desktop): retry update downloads without rechecking feed - #5642

Closed
jackwener wants to merge 1 commit into
apache:mainfrom
jackwener:codex/update-reliability
Closed

jackwener wants to merge 1 commit into
apache:mainfrom
jackwener:codex/update-reliability

Conversation

@jackwener

Copy link
Copy Markdown
Member

Summary

  • Retry a failed background asset download once after a short delay, without repeating the GitHub release-feed request.
  • Make manual download retry reuse electron-updater's already discovered update and route the About-page action to that retry path.
  • Keep provenance verification and install gating in place; add bounded diagnostic messages and regression coverage for retry success, final failure, and Nightly versions.

Verification

  • npm --workspace @maka/desktop run build
  • npx tsc -p apps/desktop/tsconfig.renderer.json --noEmit
  • 47 focused App Update tests passed, including service, UI projection, boundary, and attestation tests.
  • Signed local macOS package E2E passed: 0.2.0 -> 0.2.1 through a loopback update feed, Squirrel.Mac replacement, and automatic relaunch.

The loopback E2E deliberately bypasses remote Sigstore provenance; the attestation verifier has separate tests. No release has been published.

@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 23, 2026

@hqhq1025 hqhq1025 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the current head b7272f807a2ab764960f7c259f0966790421a86b. I found one P2 download-retry race (inline comment) and no other substantiated P0–P3 issue. I recommend fixing and testing that ordering before merge.

The PR adds one automatic asset-download retry, lets manual retry reuse cached update metadata, and adjusts the update UI/status copy. I checked automatic/manual retry, cancellation and late-promise paths, the About/sidebar status consumers, and the adjacent tests. There is no database schema migration. Current-head test, label, and package checks pass, and the branch merges cleanly with current main. I could not rerun local tests (Node 18 and no dependencies) or reproduce a signed macOS update; the finding is based on the service control flow and electron-updater's event-before-rejection ordering.

Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.

if (operation === 'check' && checkAttemptsRemaining > 0) return;
// electron-updater emits this event before rejecting downloadUpdate().
// Let the tracked promise decide whether to retry or publish the failure.
if (operation === 'download' && (activeDownload || downloadRetryPending)) return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] A first automatic download can fail before checkForUpdates() resolves. electron-updater emits error before rejecting its download promise, but activeDownload is assigned only in the .then at lines 413–418. In that window this guard is false, so the transient failure is published as error(download) (and a manual check may expose it) before trackDownload later schedules the intended retry. The new test defers the error with setImmediate, after the check result has registered activeDownload, so it misses the real ordering. Please suppress/own the in-flight automatic download from update-available onward and add a synchronous/microtask rejection regression.

@github-actions

Copy link
Copy Markdown

This pull request has had no new commits for 30 days and has been marked stale. It will be closed in 7 days unless a new commit is pushed.

Comments do not reset this timer: only a new commit does. If the pull request is intentionally long-lived, a maintainer can apply the pinned label.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

This pull request has been closed because it received no new commits during the 7-day grace period. This is not a judgement on the merit of the change; it only keeps the review queue aligned with work that is actively in flight.

The branch and review history are preserved. Push a new commit and reopen the pull request whenever the work is ready to continue.

@github-actions github-actions Bot closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines stale No qualifying activity within the lifecycle policy window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants