Repository navigation
fix(app): mount one provider tree across enterprise activation - #4805
Conversation
EnterpriseAwareAppProviders forked into two trees: a reduced pre-activation tree and the full tree after activation. AppRoot-level consumers could not see which branch they rendered under, which is how #4606/#4696's "Local context is missing" blank window shipped in 0.18.43-0.18.44. Mount the full tree unconditionally. DesktopRuntimeBoot, BrowserLoginSyncAccessBridge, AutomationRunnerBridge and GlobalQueueDrainerBridge now gate themselves on useEnterpriseActivationRequired(): they render nothing and run no effects until Den activation completes, so no privileged runtime work starts early and the providers above the children never remount when activation lands. DesktopUpdaterProvider keeps its updatePolicyKnown guard. Move providers.test.tsx under apps/app/tests so the app test script actually runs it, and extend it: pre-activation render still supplies the updater contexts, none of the gated bridges runs before activation (no boot or Automation-runner IPC, no queue drainer, no browser-login observation), all of them run after activation in the same mounted tree, and the providers above the children mount exactly once across the transition. Replace the source-slicing assertion in enterprise-activation.test.ts that depended on the removed branch.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 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 (69520 ms), confidentiality-review (66787 ms), desktop-den-sync-review (98326 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 (cfe5144e58565ec94ee8c9388fc249178e0f858f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Test evidence — a packaged flavor renders its first-launch gate without a render crash — ✅ passedSHA cfe5144 · engine v1 ✅ 0/1 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending
[probe] eventually(packaged distribution flavor) · eventually(enterprise first-launch gate mounted in #root) ℹ️ ASSERTION — 1. The enterprise desktop mounts "Link this app to your organization" on first launch without a render crash or an unexpected unhandled rejection#root text: "OpenWork Enterprise\nLink this app to your organization\n\nEnter your workspace address — the page where you downloaded this app. Sign-in finishes in your browser and returns here.\n\nWorkspace address\nCon"; render crashes: 0; allowlisted rejections: 0 of 0 known; unexpected rejections: 0
⚪ UNVALIDATED — 2. a packaged flavor renders its first-launch gate without a render crash artifact 1
Test run created 2026-09-10T16:07:11.855Z · Source: |
Test evidence — an unactivated enterprise install does not check for or download updates — ✅ passedSHA cfe5144 · 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-10T16:07:22.733Z · Source: |
Test evidence — an activated enterprise install still checks for updates — ✅ passedSHA cfe5144 · engine v1 ✅ 0/1 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending
[probe] eventually(packaged distribution flavor) · eventually(update check after activation) ℹ️ ASSERTION — 1. An activated enterprise install starts an update check without any user actionmain-process updater lines: ["Checking for update"]
⚪ UNVALIDATED — 2. an activated enterprise install still checks for updates artifact 1
Test run created 2026-09-10T16:07:44.165Z · Source: |
Test evidence — an activated enterprise install boots past the activation gate without a render crash — ✅ passedSHA cfe5144 · engine v1 ✅ 0/1 screenshots passed · 1 assertion · 1 expectations passed · 0 failed · 0 pending
[probe] eventually(packaged distribution flavor) · eventually(activated enterprise routes mounted in #root) ℹ️ ASSERTION — 1. An activated enterprise install with Den at http://127.0.0.1:60601 (closed port) mounts "Welcome to OpenWork" and never shows "Link this app to your organization"#root text: "OpenWork\nWelcome to OpenWork\n\nYour computer, but it works for you.\n\nSign in to OpenWork\nConnected to 127.0.0.1:60601\nChange\nPaste sign-in code\nPreparing workspace\nReload"; render crashes: 0; allowlisted rejections: 0 of 0 known; unexpected rejections: 0
⚪ UNVALIDATED — 2. an activated enterprise install boots past the activation gate without a render crash artifact 1
Test run created 2026-09-10T16:07:48.710Z · Source: |
|
Passed · 10/10 tests · 15/15 assertions · 5 images Commit |
Problem
EnterpriseAwareAppProvidersforked into two provider trees: a reduced one before Den activation (ConnectLink→DesktopConfig→Local) and the full one after. AppRoot-level consumers cannot see which branch they render under, which is howDesktopUpdaterProvider(#4482) ended up reading contexts the pre-activation branch never mounted and 0.18.43–0.18.44 opened to a blank window withError: Local context is missing(#4606, carried by #4696). #4696 listed collapsing the two trees as a follow-up; this is that follow-up.What this PR does
EnterpriseAwareAppProvidersalways mounts the full tree (DesktopRuntimeBoot,ConnectLink,DesktopConfig,BrowserLoginSyncAccessBridge,BrandTheme,RestrictionNotice,Local,AutomationRunnerBridge,GlobalQueueDrainerBridge,ReloadCoordinator,Toaster). TheuseEnterpriseActivationRequiredimport leavesproviders.tsx.DesktopRuntimeBoot,BrowserLoginSyncAccessBridge,AutomationRunnerBridgeandGlobalQueueDrainerBridgeeach returnnullwhileuseEnterpriseActivationRequired()is true and only mount their effect-bearing inner component after activation, so no runtime boot, Automation-runner registration, queue draining or browser-login observation starts before Den activation, and nothing above the children remounts when activation lands.DesktopUpdaterProvider'supdatePolicyKnownguard (!useEnterpriseActivationRequired() && !desktopConfig.loading), theEnterpriseActivationGateinAppRoot, and the pre-activation crash fix from fix(app): render the enterprise activation gate instead of a white screen #4606/ci(desktop): boot the packaged cloud and enterprise flavors on a fresh profile #4696 (the contexts it needed are now never forked away).providers.test.tsxmoves fromapps/app/src/react-app/shell/toapps/app/tests/sopnpm --filter @openwork/app test(bun test --isolate tests/) actually runs it, and is extended with a happy-dom render of the production nesting (BootState→Server→DenAuth→EnterpriseAwareAppProviders) that asserts: pre-activation render succeeds with the updater consumer; none of the gated bridges runs before activation (noworkspaceBootstrap/runtimeBootstrap/openworkServerRestart/engineStart/automationRunnerConfigureIPC,startGlobalQueueDrainernot called, browser-login store untouched, boot phaseidle); after an activated bootstrap snapshot + Den settings event, all four bridges run in the same root and the providers above the children mounted exactly once. The source-slicing assertion inenterprise-activation.test.tsthat depended on the removed branch now asserts the fork is gone and the three providers are present.Proof (local lane, macOS arm64, head
cfe5144e5)Lane: local. Daytona was not used: no Daytona credentials in this environment, and the packaged journeys are catalogued
placement: local(onlypackaged-smokeprovides the binaries).Unit + types (
apps/app):bun test --isolate tests/providers.test.tsx tests/enterprise-activation.test.ts tests/automation-availability.test.tspnpm typecheck(tsc -p tsconfig.json --noEmit)pnpm --filter @openwork/app testorigin/deve925c7c99with this change stashed:bun test --isolate <those 8 files>→ 31 pass, 20 fail. Pre-existing, unrelated to this diff.E2E against
--mac --dirartifacts built from this head (node apps/desktop/scripts/electron-build.mjs, thenelectron-builder --config electron-builder.enterprise.yml --mac --dir --publish neverandelectron-builder.yml --mac --dir,CSC_IDENTITY_AUTO_DISCOVERY=false):pnpm evals:e2e packaged-first-launch --localpnpm evals:e2e packaged-preactivation-updater --localpnpm evals:e2e packaged-activated-launch --localpnpm evals:e2e app-smoke --localEnv for every journey:
OPENWORK_EVAL_ELECTRON_BINARY="<app>/Contents/MacOS/<exe>" OPENWORK_EVAL_ELECTRON_RESOURCES_PREPARED=1 OPENWORK_EVAL_ENGINE=v1 OPENWORK_EVAL_SURFACES_DIR=/tmp/ow-provider-tree-profiles. No skips. Test-evidence sections for each run are in the sticky comment below.Verdict: Passed.