Repository navigation
fix(desktop): keep the updater inert until enterprise activation - #4726
Conversation
Since #4482 the updater provider mounts above the enterprise activation gate, and #4606/#4696 made the contexts it needs available there. A fresh enterprise install therefore checked the enterprise release feed and started staging the newest release within ~2 s of first launch, before any Den (and so any allowed-versions policy) was known. Renderer: automatic and menu-requested checks wait until activation is complete and the desktop config has resolved once, so the first check already honours allowedDesktopVersions. Main process: openwork:updater:check/download/ installAndRestart reject through assertDesktopActivation while activation is required, so no renderer path can reach electron-updater early. Proof: unit test for the IPC guard, and the packaged-preactivation-updater journey (red on the unfixed enterprise build, green after) wired into the packaged smoke gate.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
Additional test evidence (same head 1f3f29b)The sticky Positive control —
Red control — same journey against the unfixed enterprise build of Repro for both: build the enterprise flavor ( |
Warden review summary — ClearNative findings: 1. 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 (123631 ms), confidentiality-review (113712 ms), spec-provenance-review (149060 ms), desktop-den-sync-review (176002 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 (1f3f29b5506858157a3d8ab30a4d7ec5020ddf64). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
…empt On the unpacked Linux directory the packaged smoke gate boots, electron-updater answers checkForUpdates() with "APPIMAGE env is not defined" instead of "Checking for update", so the positive control never saw the attempt in CI.
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (24e6377cdfeea435f1fa528468d86a717246103d). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Test evidence — an unactivated enterprise install does not check for or download updates — ✅ passedSHA 24e6377 · engine v1 ✅ 0/1 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending [probe] eventually(packaged distribution flavor) · eventually(enterprise activation gate mounted in #root) ℹ️ ASSERTION — 1. An unactivated enterprise install starts no update check or download within 20s of showing "Link this app to your organization"main-process updater lines: []
⚪ UNVALIDATED — 2. an unactivated enterprise install does not check for or download updates artifact 1
Test run created 2026-09-10T02:40:25.728Z · Source: |
Evidence update for head 24e6377The sticky Positive control on 24e6377 — CI (Linux, Local Warden ( |
…et ShipIt finish (#4763) Move the release-validation runbook into its own skill with the checks the release section did not have: updater-manifest sha512 and asset presence, codesign/notarization, a Daytona-Den lane, a clone helper so packaged-first-launch never launches the extracted bundle (pre-#4726 builds self-update before activation), and how to publish evidence. The release skill keeps a pointer paragraph. The released world now clones bundles with APFS clonefile (cp -Rc) instead of a 250 MB copy and waits for Squirrel's ShipIt to finish before removing them, so a quit-time install never leaves a half-applied bundle or a resumable ShipIt state behind.
…5758) The local host removes a host-owned Electron profile when a journey's world is disposed, and electron.log lives inside that profile. The packaged smoke upload glob profiles/**/electron.log therefore never matched, so a failing packaged check (for example the Linux updater-gate timeout in #4726) left no main-process log to read. With OPENWORK_EVAL_SURFACE_LOGS_DIR set, disposeSurface now copies the surface log there before removing the profile. packaged-smoke.mjs points it at <output>/logs/<check>, outside the surfaces root that every launch prunes, and both packaged-smoke uploads (ci-tests and pr-proof) include it. Closes #4749 Signed-off-by: OmarMcAdam <[email protected]>

Problem
Since #4482
DesktopUpdaterProvidermounts atAppRoot, aboveEnterpriseActivationGate, and #4606/#4696 made the contexts it needs (DesktopConfigProvider,LocalProvider) available in the pre-activation branch. The updater therefore runs before enterprise activation:useElectronUpdaterStateauto-checks on mount (updateAutoCheckdefaults on) and auto-downloads (updateAutoDownloaddefaults on).isUpdateAllowedByDesktopConfigreturnstruewhenallowedDesktopVersionsis absent — always the case before activation, because no Den is known.openwork:updater:check/download/installAndRestarthad noassertDesktopActivationguard (only theopenwork:desktopchannel did).In 0.18.42 the updater lived inside Settings, which never mounts pre-activation, so this is new in 0.18.43+. An unactivated enterprise install could check and stage the newest enterprise-channel release before the organization's allowed-versions policy was known, defeating the containment that organizations get by pinning versions in Den.
Confirmed dynamically on a packaged enterprise
--dirbuild oforigin/dev(c744e2d), fresh profile, no user action. Within 2 s of the renderer mountingLink this app to your organization, the Electron main log contained:(The download then failed only because the unsigned
--dirbuild has noapp-update.yml; a signed release install would have staged it.)Fix (smallest diff, providers stay mounted)
Renderer —
desktop-updater-provider.tsxderivesupdatePolicyKnown = !useEnterpriseActivationRequired() && !desktopConfig.loadingand passes it touseElectronUpdaterState, which now skips both the automatic check effect and the native-menu "Check for Updates…" effect until it is true. The!desktopConfig.loadinghalf means the first post-activation check already seesallowedDesktopVersions(cached or freshly fetched) instead of the empty default. A menu request made too early stays queued and runs once the policy is known. Defaults for activated installs are unchanged.Main process —
registerUpdaterIpctakesassertActivation(default no-op);main.mjspasses the existingassertDesktopActivation.openwork:updater:check,download, andinstallAndRestartreject whiledesktopActivationRequired(DESKTOP_DISTRIBUTION, bootstrap)is true, before electron-updater is loaded or a feed selected, so no renderer path (including the menu) can reach the network early.Proof
pre-activation guard)node --test apps/desktop/electron/updater.test.mjspnpm --filter @openwork/desktop test:corepackaged-preactivation-updateron unfixed enterprise build (origin/dev)OPENWORK_EVAL_ELECTRON_BINARY=… pnpm evals:e2e packaged-preactivation-updater --localupdate checks started before activation: Checking for update: expected 1 to be +0; positive control passedpackaged-preactivation-updateron fixed enterprise build (this branch)packaged-first-launchon fixed enterprise build (no regression)pnpm evals:e2e packaged-first-launch --localpnpm --filter @openwork/app typecheckpnpm --filter @openwork/desktop typecheck:electronbun test src/react-app/shell/providers.test.tsx,…/electron-updater-state.test.ts,tests/enterprise-activation.test.tsnode --test evals/scripts/journey-ci.test.mjspnpm --dir evals typecheckspecs/packaged-preactivation-updater.e2e.test.ts/worlds/packaged-preactivation-updater.ts; the 368 remaining errors are pre-existing ondev(packages/emailjsx,worlds/session-shell.tswithResolvers, …)pnpm warden:checkon 1f3f29b (bare mode vsdev)Lane: local for everything (Daytona not attempted: this journey needs the packaged enterprise binary produced by
packaged-smoke, which is aplacement: 'local'journey).New journey
evals/specs/packaged-preactivation-updater.e2e.test.ts+evals/worlds/packaged-preactivation-updater.ts: boots the packaged enterprise binary on a fresh profile, waits for the activation heading, then watches the main-process log (electron-updater'sChecking for update/Downloading update from) for a 20 s quiet window. Positive control boots the same binary with anenterpriseActivationbootstrap (unreachable Den) and asserts the check attempt appears. Registered injourney-catalog.mjs(placement: 'local') and added as thedesktop-updater-gate-enterprisephase inpackaged-smoke.mjs, reusing the enterprise binary that script already packages.Not covered
packaged-smoke.