Repository navigation
Conversation
…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.
|
@tianlinzx is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
thx @tianlinzx we'll take a look tomorrow |
…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]>
|
Thank you @tianlinzx, your diagnosis and fix were exactly right. Your commit landed on Why it went through a second PR: fork PRs cannot receive our automated review clearance, and the new gate is red on |
* 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.
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.
Problem
Since #4482 mounted
DesktopUpdaterProviderat the outermost AppRoot layer, itsuseUpdater()hook reads theLocalandDesktopConfigcontexts during render. The pre-activation branch ofEnterpriseAwareAppProviders(#3185) mounts neither, so an enterprise build crashes withLocal context is missing(thenuseDesktopConfig 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:#rootstays empty and the CDP console shows the crash stackuseLocal → useUpdater → DesktopUpdaterProvider.Fix
Mount
DesktopConfigProviderandLocalProviderin the pre-activation branch ofEnterpriseAwareAppProviders(apps/app/src/react-app/shell/providers.tsx), so AppRoot-level consumers keep working before activation.ConnectLinkProviderstays outermost, preserving the branded connect-link activation consumer from #3185.Testing
apps/app/src/react-app/shell/providers.test.tsx: renders the realDesktopUpdaterProviderinside the pre-activation branch (TDD — watched it fail with both crash messages before the fix, pass after). The fake window stub is restored infinallyso it never leaks into other test files.apps/app/tests/enterprise-activation.test.tsto the new contract (ConnectLinkProvider+DesktopConfigProvider+LocalProviderin the pre-activation branch); the branded connect-confirm-dialog assertion is unchanged.apps/appsuite: 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.