Skip to content

fix(desktop): wait for native update readiness before restart - #4714

Merged
reachjalil merged 2 commits into
devfrom
fix/update-restart-trigger
Sep 9, 2026
Merged

reachjalil merged 2 commits into
devfrom
fix/update-restart-trigger

Conversation

@reachjalil

Copy link
Copy Markdown
Member

Problem

On macOS, electron-updater emits its download event before Squirrel finishes preparing the update. A later native staging error only reaches the log, leaving OpenWork showing Ready to install. Confirming restart can then return success while waiting for a native event that will never arrive.

Download and installation failures also disappear from the titlebar without notifying someone working outside Settings.

Changes

  • Keep macOS updates in the download/preparation state until the native installer reports readiness for the current feed.
  • Bound native staging to two minutes, propagate errors, clean up attempt listeners, and allow a fresh staging attempt for a cached download.
  • Reject stale native readiness when the selected version changes; preserve staged downloads across unrelated transient check errors.
  • Show existing update notifications for failed download/preparation and restart requests.
  • Extend the existing background-update journey with failure visibility, retry, and confirmation assertions. Keep policy checks, opt-out, and Keep working behavior intact.

Verification — Incomplete

Head: 863e07fe861b976a8ee9abcb56a429500aa0e715
Base: 440504bb9010ea7be822f5f9144e2627c84d32d3

Passed

  • node --test apps/desktop/electron/updater.test.mjs — exit 0; 33 passed, 0 failed, 1 existing platform-specific skip. Includes delayed native preparation, staging error, timeout, retry, old-feed events, and transient-check preservation.
  • node apps/app/node_modules/typescript/bin/tsc -p apps/app/tsconfig.json --noEmit — exit 0.
  • git diff --check — exit 0.

Skipped / blocked

  • The unit test for non-macOS cache paths is skipped on macOS.
  • pnpm evals:e2e background-desktop-update — exit 1 before placement or test execution. pnpm attempted dependency installation and stopped with ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY. No journey evidence was produced.
  • pnpm warden:check — exit 1 at the same dependency preflight. Expected: diff-security-review, confidentiality-review, spec-provenance-review, and desktop-den-sync-review; actually reviewed: none. No findings or clearance were produced. Head and base were unchanged before/after the command.

Remaining proof

Restore the worktree's pinned dependency installation, then run the two blocked commands above. The renderer journey uses a deterministic update bridge and does not prove Squirrel itself; a signed macOS packaged update must separately verify preparation, replacement, and relaunch. No installed application was restarted during this work.

Review notes

The native boundary uses electron-updater 6.8.3's runtime nativeUpdater property; it is not public in that package's TypeScript declaration. Missing native access fails closed. This fixes a source-confirmed failure sequence, not a log-confirmed diagnosis of a particular installation attempt. General shutdown hardening is intentionally out of scope.

@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 9, 2026 11:50pm UTC
openwork-den Ready Ready Preview Sep 9, 2026 11:50pm UTC
openwork-diagnostics Ready Ready Preview Sep 9, 2026 11:50pm UTC
openwork-landing Ready Ready Preview, v0 Sep 9, 2026 11:50pm UTC

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (76232 ms), confidentiality-review (123973 ms), spec-provenance-review (114474 ms), desktop-den-sync-review (161244 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 2/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

diff-warden[bot]
diff-warden Bot previously approved these changes Sep 9, 2026

@diff-warden diff-warden Bot 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (863e07fe861b976a8ee9abcb56a429500aa0e715). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Passed · 3/3 tests · 4/4 assertions · 2 images

Commit e162b0ca855fc0b020749d40b7b6225f3f8dd226 · selected evidence

Open review report

@diff-warden diff-warden Bot 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (e162b0ca855fc0b020749d40b7b6225f3f8dd226). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@reachjalil
reachjalil merged commit 8f6d464 into dev Sep 9, 2026
27 checks passed

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — e162b0ca Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-app — e162b0ca Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-den — e162b0ca Deployed Sep 9, 2026 by vercel[bot]
Preview – openwork-diagnostics — e162b0ca Deployed Sep 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant