Repository navigation
fix(desktop): keep an unactivated enterprise install off the network until a workspace address is submitted - #4809
Conversation
…until a workspace address is submitted Before activation an enterprise install knows no organization server, yet the renderer already probed app.openworklabs.com/api/runtime-config during bootstrap, queued the app_opened analytics event for PostHog and prefetched Cloud inventory from AppRoot above the activation gate, and the architecture gate made the main process fetch the public GitHub release manifest on every boot even when the installed build matched the machine. - den.ts: boot-time bootstrap resolution skips the runtime-config probe while activation is required; setDenBootstrapConfig (the submitted address) and an activated bootstrap still resolve it. - app-root.tsx: analytics init/capture and the Cloud inventory prefetch wait until outboundEgressAllowed(): activation complete and the desktop config resolved once, mirroring the updater gate. Installs that never require activation are unchanged. There is no Den analytics/telemetry policy switch today; the local analyticsEnabled preference still applies afterwards. - main.mjs: resolveArchitectureInfo only fetches the release manifest when the app and machine architectures differ. Spec packaged-preactivation-egress.e2e.test.ts boots the packaged enterprise binary behind a refusing logging proxy (--proxy-server) and asserts zero non-loopback requests until a workspace address is submitted, then only that host; the activated control proves the witness sees runtime-config and analytics once activated. packaged-smoke runs it for the enterprise flavor.
|
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 (60995 ms), confidentiality-review (93067 ms), spec-provenance-review (53620 ms), desktop-den-sync-review (79621 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 (c9ab2937e2d900843bb7b6ea651bf1f43c2eeecd). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
On Windows and Linux Chromium's spellchecker fetches its Hunspell dictionary from redirector.gvt1.com as soon as a text field mounts, which the packaged smoke gate's Linux run of packaged-preactivation-egress caught on the fresh enterprise install. Disable the spellchecker while activation is required and re-enable it on both activation transitions (connect link and the bootstrap write from the handoff exchange).
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (4f378924372d9feaefc69e46177a39292a3d3936). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
…sion access setSpellCheckerEnabled(false) ran two awaits after session.defaultSession was first touched, and Electron's Session constructor already calls SpellcheckService::InitializeDictionaries there, so the Hunspell download had left before the flag flipped (the Linux packaged smoke run still saw redirector.gvt1.com). Clear the dictionary list synchronously with that first access instead — the download waits on a file-thread hop — and restore the held languages on both activation transitions. Electron re-defaults an empty persisted list on the next boot, so quitting before activation cannot leave the spellchecker off.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (9f426edea01f73d76713c8f39c516a3724af8cd7). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Test evidence — an unactivated enterprise install makes no request outside loopback until a workspace address is submitted — ✅ passedSHA 9f426ed · engine v1 ✅ 0/2 screenshots passed · 2 assertions · 2 expectations passed · 0 failed · 0 pending [probe] eventually(packaged distribution flavor) · eventually(enterprise activation gate mounted in #root) ℹ️ ASSERTION — 1. An unactivated enterprise install makes no non-loopback request within 25s of showing "Link this app to your organization"proxy log: []
ℹ️ ASSERTION — 2. After a workspace address is submitted, the install contacts only den.example.testproxy log: ["CONNECT den.example.test:443","CONNECT den.example.test:443"]
⚪ UNVALIDATED — 3. an unactivated enterprise install makes no request outside loopback until a workspace address is submitted artifact 1
⚪ UNVALIDATED — 4. an unactivated enterprise install makes no request outside loopback until a workspace address is submitted artifact 3
Test run created 2026-09-10T16:40:18.312Z · Source: |
|
Positive control for the sticky test-evidence comment above (same PR head 9f426ed, same witness, macOS local lane). Published as a plain comment because the publisher keeps one test run per sticky comment. The Linux proof for the spellchecker fix is the Test evidence — an activated enterprise install still resolves its Den and reports analytics — ✅ passedSHA 9f426ed · engine v1 ✅ 0/1 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending
[probe] eventually(packaged distribution flavor) · eventually(Den runtime-config probe and analytics flush after activation) ℹ️ ASSERTION — 1. An activated enterprise install contacts its Den (den.example.test) and flushes analytics (us.i.posthog.com) without any user actionproxy log: ["CONNECT den.example.test:443","CONNECT github.com:443","CONNECT us.i.posthog.com:443"]
⚪ UNVALIDATED — 2. an activated enterprise install still resolves its Den and reports analytics artifact 1
Test run created 2026-09-10T16:40:46.771Z · Source: |


Problem
An unactivated enterprise build made non-loopback requests before the person entered a workspace address, i.e. to hosts nobody in the organization chose:
app.openworklabs.com/api/runtime-config—resolveDenBootstrapConfigWithRuntimeApiguarded only onisDesktopRuntime(), soinitializeDenBootstrapConfigprobed the hosted default on every fresh boot.us.i.posthog.com) —AppRootcalledinitAnalytics()/captureAnalyticsEvent("app_opened")aboveEnterpriseActivationGate;isAnalyticsEnabled()had no activation check.github.com—ArchitectureMismatchGate→openwork:system:architecture→resolveArchitectureInfo()fetched the public release manifest on every boot, even when the installed build already matched the machine.redirector.gvt1.com— Chromium's spellchecker downloads its Hunspell dictionary from Google as soon as a text field mounts (Windows/Linux only; macOS uses the native spellchecker).Fix (smallest)
apps/app/src/app/lib/den.ts— boot-time paths (initializeDenBootstrapConfig×3,refreshDenBootstrapConfigFromShell) go throughresolveBootBootstrapConfig, which skips the runtime-config probe whileenterpriseActivationRequired().setDenBootstrapConfig(the submitted address) and an activated bootstrap still resolve it.apps/app/src/app/lib/enterprise-activation.ts— newoutboundEgressAllowed(distribution, bootstrap, { desktopConfigLoading }): always true for installs that never require activation; for activation-required installs true only once activated and the desktop config has resolved once (same readinessDesktopUpdaterProviderwaits for).apps/app/src/react-app/shell/app-root.tsx— analytics init/capture and the Cloud inventory prefetch wait foruseOutboundEgressAllowed().apps/desktop/electron/main.mjs—resolveArchitectureInfoonly fetches the release manifest whenappArch !== systemArch; a matching install never shows the download so the fetched URL was unused.apps/desktop/electron/main.mjs—holdSpellcheckerUntilActivation()runs synchronously with the firstsession.defaultSessionaccess (Electron'sSessionconstructor callsSpellcheckService::InitializeDictionariesright there; the download itself waits on a file-thread hop) and clears the dictionary list while activation is required;releaseSpellcheckerAfterActivation()restores the held languages on both existing activation transitions (connect link, bootstrap write from the handoff exchange). Electron re-defaults an empty persisted list at the next boot, so quitting before activation cannot leave the spellchecker off. macOS uses the native spellchecker; the calls are no-ops there.packages/docs/start-here/outbound-network-access.mdx— new "Before enterprise activation" note.Den policy switch: there is no analytics/telemetry switch in
desktopPolicyDefinitions/desktopConfigSchematoday, so none is honoured; the localanalyticsEnabledpreference still applies after activation. Waiting for the desktop config to resolve once means a future policy would be read before the first event.Public/cloud flavors:
outboundEgressAllowedreturnstrueimmediately when activation is not required, so their boot is unchanged (unit-tested).Proof
Spec
evals/specs/packaged-preactivation-egress.e2e.test.ts+evals/worlds/packaged-preactivation-egress.ts: boots the packaged enterprise binary on a fresh profile behind a refusing logging forward proxy (ELECTRON_EXTRA_LAUNCH_ARGS=--proxy-server=…, which Chromium's stack,net.fetchin main and electron-updater all honour; loopback is implicitly bypassed).https://den.example.test) → the only host contacted isden.example.test; the gate stays up (proxy refuses the exchange) and analytics stay silent.den.example.testand the PostHog flush, proving the proxy observes renderer + main traffic and that analytics resume after activation.Red on
origin/dev(unfixed binary, macOS):["CONNECT app.openworklabs.com:443","CONNECT github.com:443"]during the quiet window; the first CI run on Linux additionally surfacedCONNECT redirector.gvt1.com:443(spellchecker), fixed in the follow-up commits (the first attempt withsetSpellCheckerEnabled(false)ran too late; see commit messages). Green on this branch. Added topackaged-smoke.mjs(enterprise flavor) and the journey catalog so CI's packaged smoke gate runs it on Linux.Unit tests
apps/app/tests/preactivation-egress.test.ts(8 tests; 3 red on dev): boot skips runtime-config for unactivated enterprise, resolves it for activated / public / submitted address;outboundEgressAllowedmatrix; AppRoot wiring.Lane: local (packaged specs are
placement: local— the packaged enterprise binary is only produced by packaged-smoke; not a Daytona lane). Test-evidence sections are published in the sticky comment below.Related: ASTRA-1 follow-up E1.