Skip to content

fix(app): render the enterprise activation gate instead of a white screen - #4606

Closed
tianlinzx wants to merge 1 commit into
different-ai:devfrom
tianlinzx:fix/enterprise-preactivation-white-screen
Closed

tianlinzx wants to merge 1 commit into
different-ai:devfrom
tianlinzx:fix/enterprise-preactivation-white-screen

Conversation

@tianlinzx

Copy link
Copy Markdown
Contributor

Problem

Since #4482 mounted DesktopUpdaterProvider at the outermost AppRoot layer, its useUpdater() hook reads the Local and DesktopConfig contexts during render. The pre-activation branch of EnterpriseAwareAppProviders (#3185) mounts neither, so an enterprise build crashes with Local context is missing (then useDesktopConfig must be used within a DesktopConfigProvider) before the activation gate can render.

Result: a blank white window on first launch of an unactivated enterprise install — the activation page ("Link this app to your organization") never appears, with no ErrorBoundary to recover. Reproduced in dev via OPENWORK_DESKTOP_DISTRIBUTION=enterprise pnpm dev: #root stays empty and the CDP console shows the crash stack useLocal → useUpdater → DesktopUpdaterProvider.

Fix

Mount DesktopConfigProvider and LocalProvider in the pre-activation branch of EnterpriseAwareAppProviders (apps/app/src/react-app/shell/providers.tsx), so AppRoot-level consumers keep working before activation. ConnectLinkProvider stays outermost, preserving the branded connect-link activation consumer from #3185.

Testing

  • New behaviour test apps/app/src/react-app/shell/providers.test.tsx: renders the real DesktopUpdaterProvider inside the pre-activation branch (TDD — watched it fail with both crash messages before the fix, pass after). The fake window stub is restored in finally so it never leaks into other test files.
  • Updated the providers source-shape assertion in apps/app/tests/enterprise-activation.test.ts to the new contract (ConnectLinkProvider + DesktopConfigProvider + LocalProvider in the pre-activation branch); the branded connect-confirm-dialog assertion is unchanged.
  • Full apps/app suite: 1345 pass / 8 fail, identical failure set to the pre-change baseline (verified by stashing the change and diffing the failure lists — the 8 are pre-existing).
  • pnpm --filter @openwork/app typecheck: clean.
  • Runtime-verified in dev: the enterprise activation gate now renders fully (workspace-address input + Continue), instead of the white screen.

…reen

Since different-ai#4482 mounted DesktopUpdaterProvider at the outermost AppRoot
layer, its useUpdater() hook reads the Local and DesktopConfig contexts
during render. The pre-activation branch of EnterpriseAwareAppProviders
(different-ai#3185) mounts neither, so an enterprise build crashed with "Local
context is missing" (then "useDesktopConfig must be used within a
DesktopConfigProvider") before the activation gate could render — a
blank window on first launch of an unactivated install, with no
ErrorBoundary to recover.

Mount DesktopConfigProvider and LocalProvider in the pre-activation
branch so AppRoot-level consumers keep working; ConnectLinkProvider
stays outermost so the branded connect-link consumer keeps its place.

Tested with a behaviour test that renders the real DesktopUpdaterProvider
inside the pre-activation branch (TDD: watched it fail with both crash
messages before the fix), and updated the providers source-shape
assertion in tests/enterprise-activation.test.ts to the new contract.
Full apps/app suite: no new failures against the pre-change baseline.
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@tianlinzx is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
vercel Bot temporarily deployed to Preview – openwork-landing September 8, 2026 01:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics September 8, 2026 01:05 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-den September 8, 2026 01:05 Inactive
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
openwork-den Skipped Skipped Sep 8, 2026 1:05am UTC
openwork-diagnostics Skipped Skipped Sep 8, 2026 1:05am UTC
openwork-landing Skipped Skipped Sep 8, 2026 1:05am UTC

@benjaminshafii

Copy link
Copy Markdown
Member

thx @tianlinzx we'll take a look tomorrow

yomgui added a commit that referenced this pull request Sep 9, 2026
…h profile (#4696)

Carries the enterprise activation gate fix from #4606 and adds the packaged-first-launch journey to packaged-smoke so the cloud and enterprise first-launch gates are booted on every merge.

Co-authored-by: tianlinzx <[email protected]>
@yomgui yomgui closed this in #4696 Sep 9, 2026
@yomgui

yomgui commented Sep 9, 2026

Copy link
Copy Markdown
Member

Thank you @tianlinzx, your diagnosis and fix were exactly right. Your commit landed on dev in #4696 (authorship preserved, Co-authored-by on the squash), together with a packaged-build CI gate that boots the enterprise and cloud flavors on a fresh profile so this class of crash cannot ship again. Against the released 0.18.44 that gate fails in seconds naming Local context is missing.

Why it went through a second PR: fork PRs cannot receive our automated review clearance, and the new gate is red on dev without your fix, so they had to merge as one. The fix will ship in the next patch release. Sorry it took a release cycle to get to it.

yomgui added a commit that referenced this pull request Sep 10, 2026
* fix(desktop): keep the updater inert until enterprise activation

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.

* test(evals): count electron-updater's AppImage refusal as a check attempt

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.
yomgui added a commit that referenced this pull request Sep 10, 2026
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.

This branch was previously deployed

3 inactive deployments
Preview – openwork-landing — 4144db4f Deployed Sep 8, 2026 by vercel[bot]
Preview – openwork-diagnostics — 4144db4f Deployed Sep 8, 2026 by vercel[bot]
Preview – openwork-den — 4144db4f Deployed Sep 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants