LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-maryam
createdAtNov 20, 2026, 3:36 PM
updatedAtNov 20, 2026, 4:21 PM
githubUrlhttps://github.com/neomjs/neo/issues/21579
authorneo-gemini-maryam
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 20, 2026, 4:21 PM

Headless DockWorkspace commits hang refreshPromise in promiseUpdate

Closed v14.0.0/archive-v14-0-0-chunk-5 bugaicoredashboard
neo-gemini-maryam
neo-gemini-maryam commented on Nov 20, 2026, 3:36 PM

Context

When Workstation cold-boots with a saved vessel workspace (apps/workstation/view/VesselWorkspace.mjs:253 → createPopupWorkspace(..., {committed: true, windowId: null})) or detaches a closed popup window while retaining its Group participant (src/dashboard/dock/Workspace.mjs:1091-1094 / apps/workstation/view/PopupWorkspace.mjs:260-261 → this.parent?.remove(this, false, true); this.windowId = null), the Workspace is unmounted (mounted: false), parentless (parent: null), and windowless (windowId: null).

Any Group commit or projectDockZoneDocument call against that headless Workspace (cold-hydrate, Reset to default, Undo, transferItem) hangs refreshPromise and projectionCycle.adoption indefinitely inside await host.promiseUpdate().

Curated labels (good first issue, help wanted) are omitted because this is an active maintainer lane on Neo.dashboard.dock.Workspace claimed immediately.

The Problem

In src/dashboard/dock/Workspace.mjs:2688-2696:

  1. Neo.currentWorker?.isWindowDeparted?.(host.windowId) returns false when host.windowId is null (src/worker/Base.mjs:433).
  2. refreshDockWorkspace falls into if (!host.mounted) await host.promiseUpdate().
  3. Under active VDOM updates (!Neo.config.unitTestMode || Neo.config.allowVdomUpdatesInTests), VdomLifecycle#updateVdom (src/mixin/VdomLifecycle.mjs:1480-1509) registers {resolve, reject} in VDomUpdate.promiseCallbackMap[host.id] and either parks on needsVdomUpdate = true (!vnodeInitialized) or waits on mountedPromise.
  4. While the workspace remains headless (e.g. a saved vessel window that is never reopened, or across cold-hydrate followed by Reset to default), refreshPromise never settles, projectionCycle.adoption never resolves to null, subsequent cycles stall at queuedAt without startedAt, and VDomUpdate.promiseCallbackMap retains an orphaned callback entry. If multiple non-Group projections queue before a later mount, the first stale projection also wakes and reconciles before its successor instead of coalescing.

The Architectural Reality

  • src/dashboard/dock/Workspace.mjs:2052-2080: afterSetMounted(true) already owns deferred replay of me.departedProjection via me.chainProjection(parked).
  • src/dashboard/dock/Workspace.mjs:2688-2691: #20017 (4763bcb8f9) parks {document, refreshOptions, tabInsertDescriptor} in me.departedProjection when isWindowDeparted(host.windowId) is true, letting Cycle#run's .finally(() => me.adopt(null)) (src/dashboard/dock/projection/Cycle.mjs:99) settle adoption with null.
  • src/mixin/VdomLifecycle.mjs:1462: unit tests with allowVdomUpdatesInTests: false (test/playwright/unit/dashboard/DockWorkspace.spec.mjs:195-240) exercise in-memory component reconciliation on standalone unmounted workspaces (windowId: null, parent: null) where promiseUpdate() resolves synchronously as a no-op. Note that an unadopted component defaults parentId to 'document.body' (parent: null), whereas a mounting workspace inside a window's Viewport carries a live parent container and/or windowId.

Design authority: "A headless Workspace owns no visible tree before binding. Once mounted, an absent shell at {@link #dockShellIndex} enters the ordinary committed-document refresh" (src/dashboard/dock/Workspace.mjs:2055-2057) and "a cycle that is skipped, superseded, destroyed or repaired settles it with null, and the refresh stays the gate" (src/dashboard/dock/projection/Cycle.mjs:13-14).

Decision Record impact: none.

The Fix

In Neo.dashboard.dock.Workspace#refreshDockWorkspace (src/dashboard/dock/Workspace.mjs:2688):

  • Treat an unmounted, parentless, windowless host under active VDOM updates (!host.mounted && !host.windowId && !host.parent && (!Neo.config.unitTestMode || Neo.config.allowVdomUpdatesInTests)) identically to Neo.currentWorker?.isWindowDeparted?.(host.windowId): store {document, refreshOptions, tabInsertDescriptor} in me.departedProjection and return immediately.
  • When the headless workspace later binds and mounts into a container/window, afterSetMounted(true) replays the newest parked departedProjection once through chainProjection.

Acceptance Criteria

  • Calling projectDockZoneDocument on an unmounted headless Neo.dashboard.dock.Workspace (windowId: null, parent: null, allowVdomUpdatesInTests: true) settles refreshPromise and resolves projectionCycle.adoption to null without registering callbacks in VDomUpdate or projecting premature shells while headless.
  • Multiple headless projectDockZoneDocument commits coalesce into departedProjection, and subsequent container binding + mount (bindAndMount) projects the latest committed document once.
  • Detaching a mounted DockWorkspace (parent.remove(workspace, false, true); workspace.windowId = null), committing a new document while detached, and remounting into a successor container projects the updated document cleanly.
  • Existing unit suites (DockWorkspaceFirstProjection.spec.mjs and DockWorkspace.spec.mjs, including standalone allowVdomUpdatesInTests: false reconciliation) pass.

Out of Scope

  • Changing VdomLifecycle#updateVdom semantics for components actively mounting inside a parent container.
  • The Ubuntu-only WorkstationBoot.spec.mjs:273 workstation-main Reset render-stall race (#21209), where workstation-main is already mounted with a live windowId.

Avoided Traps

  • Checking !host.windowId unconditionally without (!Neo.config.unitTestMode || Neo.config.allowVdomUpdatesInTests) and !host.mounted && !host.parent would skip in-memory reconciliation in standalone unit specs (DockWorkspace.spec.mjs:195) or skip initial mount ordering when a workspace is already attached to a mounting parent container.
  • Checking !host.parentId instead of !host.parent misses freshly constructed headless workspaces whose default parentId is 'document.body' (host.parent === null).

Related

  • #20017 / PR #20032 (4763bcb8f9 — introduced departedProjection for isWindowDeparted(host.windowId))
  • #20152 / PR #20160 (PopupWorkspace native detach lifecycle)

Live latest-open + closed sweep: checked latest 20 open (61 open, red band) + open and closed search (PopupWorkspace OR departedProjection OR refreshDockWorkspace, Out of Scope / Avoided Traps read on #20017, #20025, #20029) at 2026-11-20T14:35Z; no equivalent or prior exclusion found. A2A in-flight sweep: checked latest 30 messages (status: 'all') at 2026-11-20T14:35Z; no competing claim. MC sweep: "PopupWorkspace cold boot windowId null promiseUpdate hangs refreshPromise headless Workspace", 5 results, no prior decision found. Own-assignment sweep: 1 open (#21555, PR #21556 approved at merge gate), none overlapping. Structure-map: N/A (src/dashboard/dock/ engine fix; no ai/ or .agents/skills/ touch).

Origin Session ID: 1a9e9c90-1e66-4bcd-831a-57506f77a88b Retrieval Hint: "PopupWorkspace cold boot windowId null refreshDockWorkspace promiseUpdate hangs departedProjection"

Authored by Maryam (Gemini 4 Carbon, Antigravity). Session 1a9e9c90-1e66-4bcd-831a-57506f77a88b. 🧭

tobiu referenced in commit 3807502 - "fix(dashboard): park commits on headless DockWorkspace before mount (#21579) (#21582)" on Nov 20, 2026, 4:21 PM
tobiu closed this issue on Nov 20, 2026, 4:21 PM