Repository navigation
fix(serve): initialize the updater in headless Electron serve - #27771
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Headless serve updater setup has no identified blocker and is ready to merge after normal checks. Pre-merge checks |
|
…ed clients can update it
9693bad to
43a12a8
Compare
ELI5
A headless
orca serverunning on Electron never starts its updater, because the updater is only set up when a desktop window opens and serve has no window. Paired clients therefore see "updater unavailable" forever and can't update that server. This PR starts the updater for headless serve right after the server reports ready.What Changed
setupAutoUpdaterwas reached only throughscheduleMainWindowAutoUpdaterSetup(windowready-to-show). In Electron serve mode that never happens, soautoUpdaterInitializedstayed false andgetRemoteServerUpdateSupport()answeredupdater-unavailable. This affected CLI-supervised macOS serve ([Bug]: CLI-supervised macOS orca serve never initializes remote updater #22261) and every other Electron serve.launchServeModecalls a newsetupHeadlessServeAutoUpdater(store, …)after readiness has been printed. It is deferred withsetImmediate, because loading the updater is slow on cold machines.resolveUpdateInstallMode(true)), the same store-backed hooks the window path uses, and a pre-quit store flush that aborts the install if the flush fails.setupAutoUpdaternow acceptsnullfor the window. Its window sends were already optional. A later window attach still sets the window; a call without a window never clears one that is already set.availableand installs through the existing supervisor handoff. Squirrel staging is already deferred to install time by fix(updater): install macOS orca serve updates instead of waiting on Squirrel forever #27466.manual-service-update-requiredinstead ofunavailable.Why
This is B1 of the headless-serve robustness plan. Window-driven setup was the only entry point, and making the window optional is the smallest fix. The updater already stores its status independently of the window, and remote snapshots read that status. A separate updater core, or a "status sink" layer, was considered and rejected as a framework with no second user.
Linked Issue
Fixes #22261
Visual Proof
N/A. Headless serve has no UI. Paired clients now render the existing update states instead of "unavailable".
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
main-window-updater-headless-serve.test.ts: setup runs after readiness, without a window, in the serve install mode, with the store hooks and pre-quit flush; an updater that fails to load never throws through serve startup.The existing window-path tests (
main-window-updater-deferred-setup.test.ts) and the updater and startup suites still pass.pnpm tc, oxlint andcheck:code-quality:changedpass locally.Not run: a real-host update of a LaunchAgent-supervised serve. That is real-host test 2 in the design.
Review
Agent skill upstream boundary
Notes
autoDownloadis off). An install still needs an explicit request and stays subject to the existing per-mode refusals.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)