Repository navigation
fix(updater): re-validate the desktop version policy before installing a downloaded update - #4761
Conversation
…g a downloaded update A downloaded update stayed installable after the organization revoked its version from allowedDesktopVersions. Refresh the desktop config before bridge.installAndRestart() and re-run the allow decision on the downloaded version; a revoked version is not installed and the update returns to the blocked-by-policy state so the user can check again. An absent allowlist still means unrestricted, and a failed refresh (offline) falls back to the last known config instead of blocking on a network error.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
Warden review summary — ClearNative 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 (42770 ms), confidentiality-review (72613 ms), spec-provenance-review (69019 ms), desktop-den-sync-review (76075 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (eda8d6a9ce864b116501658d04e7247b800c5867). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 6/6 tests · 7/7 assertions · 5 images Commit |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (dfa81c7c965644e80c72789edfb1237dd5d01f86). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (513e544c0a51b947d29542b138f725ca4b049aac). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (d5040026407c9b38d7c20328093cc7a5847d7013). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Passed — explicit-install scope, final head
|
Resolves evals/specs/background-desktop-update.e2e.test.ts after #4745 was squash-merged to dev (a7748b2): keep this PR's version, which is a superset of #4745 and #4761 and adds only its own step (automatic checks stay on through the first failed install, asserted, then are switched off inside iteration 0). The merged tree differs from dev in this spec only.
…to-check skip with automatic checks on (#4821) * fix(app): close the restart prompt and command palette synchronously on dismiss Base UI keeps a dialog popup mounted (and partially opaque) until its exit animation or transition finishes, so the restart prompt and the command palette stayed visible for 100-200 ms after Keep working / Escape. Hide the popup with display:none as soon as it is closed; Base UI then unmounts it on the next frame. * fix(app): keep background update checks paused after an install fails After a failed install the updater status is error/install, which the automatic check treated like idle: the next focus/online/interval trigger (or an effect re-run once the 15-minute window had passed) re-checked, auto-downloaded the same update and left Settings' Check now disabled behind "Downloading update…". The update is already downloaded, so a background re-check cannot fix an installer failure; keep the failure and let the person retry from Settings. * test(evals): prove a failed install does not restart the background download loop Return to the app after the check interval before retrying from Settings, and assert Settings still shows the install failure with no new download. Apply the custom branding only for the final confirmed restart: the eval's dev-bridge branding does not survive the Den settings sync that opening Settings performs for a signed-out app (the failure loop visits Settings). * test(evals): exercise the error/install auto-check skip with automatic checks on The first failed install and its returnToApp() now run with Check automatically still on, so the counters staying at checks 6 / downloads 3 is observed against the updater's error/install guard rather than the disabled switch. The switch is turned off right after, so the second retry and the final install keep #4761's isolation.
* fix(desktop): restore forced sign-in and version allowlist #5131 suspended desktop feature-policy enforcement but also routed two non-policy controls through the same switch: - Required sign-in is a property of the enterprise and cloud builds (desktop-distribution.mjs); desktop-bootstrap.json can only raise it. The app shell ignored it on desktop, so activated enterprise installs opened local work without Den sign-in. - allowedDesktopVersions is an organization setting (PATCH /v1/org), not a desktop policy. The runtime projection dropped it, so the updater and recovery picker stopped honouring the organization's version pin. Restore both. Feature-policy toggles and execution rules stay suspended. The updater again waits for the organization's desktop config before its first check, and refreshFresh fetches instead of returning the cached projection so the install-time re-check (#4761) sees a revoked version. Specs: packaged-activated-launch expects the forced sign-in surface again; background-desktop-update proves a revoked version is not installed and a re-approved one is. Docs: the enterprise deployment page no longer claims feature policies are enforced. Signed-off-by: Benjamin Shafii <[email protected]> * fix(desktop): keep update checks working when Den is unreachable refreshFresh now always fetches the organization's desktop config, so a failed fetch (offline, or an older or unavailable Den) would have failed Check now and the alpha channel resolution. Fall back to the last known config, matching the install re-check's existing offline rule. Rename updatePolicyKnown to allowedVersionsKnown and split the MDM docs: allowed desktop versions are an organization setting, not a desktop policy. Signed-off-by: Benjamin Shafii <[email protected]> * test(evals): expect the cloud build's sign-in gate on first launch The cloud build requires sign-in again, so its packaged first launch shows the sign-in surface (the contract before #5131) instead of the signed-out task composer. Signed-off-by: Benjamin Shafii <[email protected]> --------- Signed-off-by: Benjamin Shafii <[email protected]>
Summary
Narrow follow-up to #4726: revalidate organization permission before explicit renderer install/restart of an already-downloaded version. This PR does not close the broader managed-updater finding; the same owner is handling remaining phases in #4767.
Changes
DesktopConfigProvider.refreshFreshbefore the renderer callsbridge.installAndRestart().isUpdateAllowedByDesktopConfig. The Den support decision was made at check time; this pure policy check avoids adding a network dependency for installing an already-approved download. Alpha keeps its existing channel/Den checks and reusesisAlphaUpdateAllowedfor version eligibility.Validation
pnpm --filter @openwork/app typecheck, exit 0.pnpm --dir apps/app exec bun test --isolate tests/electron-updater-install-policy.test.ts tests/version-gate.test.ts, exit 0, 26 passed / 0 failed / 0 skipped.PATCH /v1/org, confirm titlebar restart, observe blocked UI and zero bridge installs; reapprove and freshly download, then install through Settings as the positive control. All three background-update/revocation/recovery cases passed on final headd5040026407c9b38d7c20328093cc7a5847d7013in two complementary Daytona name-filtered runs (exit 0 each; all names covered). Evidence, commands, prior reds, and final local Warden review.origin/devcontrol634df629a919db504e27d0f00962dc772344e42a: respectively 366 errors, 9 errors, 39 violations, 19 and 14 ratchet failures. No added-line diagnostics. Existingfirst-run.tslines 211/212/219 require an ES2024 Promise library; the configured library is ES2023. No unrelated baseline or.githubedits.Explicitly not fixed here — #4767
The executed current-guard source safety matrix on the product change had 8 passed / 8 failed / 0 skipped (diagnostic, not journey proof). Post-download revocation now blocks explicit renderer restart. These safety assertions still fail:
Separate onboarding/branding staging and restart, native staging invalidation, and actual OS installation are not covered by this renderer fix. No native exploit or broader closure is claimed. Public/unmanaged and explicitly unrestricted controls still pass.