Context
Emmy's independent capture for #21087's Round 2 logged two console errors, and they reproduce at c4e6556490: at 1280×800, sign in, open Mail and Calendar, then sign out.
insertNodeBatch: Parent not found {parentId: neo-component-7, index: 4}
insertNodeBatch: Parent not found {parentId: neo-component-9, index: 4}neo-component-7 and neo-component-9 are the two windows' WebDesktop.view.AppViews. With one window open there is one error, and with none there is none.
The Problem
Signing out paints the console red, once for each open window. Nothing visible breaks, since the windows are leaving anyway. But the demo is the engine's featured example for 14.0, and an error on its most basic action invites a stranger to distrust everything after it. A console listener in a test would also fail on it.
The Architectural Reality
WebDesktop.view.ViewportController#onSignOutButtonClick calls hideAllWindows() and then setState({account: null, …}) synchronously. hideAllWindows() hides each window inside promise.then(), so every hide runs one microtask after the state change.
- The state change reaches each window's
AppView through its account binding. afterSetAccount calls renderCard(), which rebuilds the card and calls update(). The window is still mounted then, so the update goes out to the VDOM worker.
Neo.dialog.Base#hide(false) unmounts a body-level window through component.Base#unmount(). That sends removeNode straight to the main thread, which applies it before the AppView's update returns. The insert batch then finds no parent.
- In the other order, the engine already handles this:
unmount() sets mounted = false, container.Base#afterSetMounted cascades it to the items (#19973), and an update on an unmounted component waits for its next mount (VdomLifecycle#updateVdom).
- Design authority: n/a. The defect excuse is the fenced console error above.
The Fix
onSignOutButtonClick awaits hideAllWindows() before it changes the state, and hideAllWindows() returns the promise of all hides. pendingSignIn is still cleared synchronously, so a sign-in reading its arrangement is cancelled at the click, as before.
- A unit arm in
ViewportController.spec.mjs proves the order: every window is hidden before the state changes.
- No e2e arm. A console-listening e2e spec stayed green on the pre-fix head under the e2e harness, even after both windows finished opening, so it cannot catch this race and would only look like coverage. The unit arm carries the order, and a browser witness carries the symptom.
Acceptance Criteria
Out of Scope
- The engine's handling of an update that is already in flight when an ancestor unmounts. The app fix removes the ordering; a guard in the delta pipeline would be a separate engine question.
AppView's full-card rebuild in renderCard().
Avoided Traps
- Skipping
renderCard() for a null account. That hides this one trigger, not the ordering: any later state a window's content binds would race the same way.
Related
Ownership: self-assigned. It is the next fix in my web desktop lane, stacked on approved PRs, so it is not marked for contributors.
Live latest-open + closed sweep: checked latest 20 open + open and closed search ("insertNodeBatch Parent not found", "sign out window unmount update", "Parent not found insertNode"; hits are engine delta work, closed, none on this ordering) at 2026-11-16T04:27Z. No equivalent found. Backlog: 66 open (red); the owning epic is #21061.
A2A claim sweep: every unread message read at 04:24Z; no overlapping claim. Emmy, who found the errors, was told at 04:27Z that I take the fix.
MC sweep: "insertNodeBatch Parent not found when a window is hidden while its child component re-renders", 10 results; prior art is #19973 (the mounted cascade on a parent's removal), no decision on this ordering.
Own-assignment sweep: 13 open, none overlapping.
Origin Session ID: 7ceb0de7-6fcc-4777-879b-3a305deac77f
Retrieval Hint: "web desktop sign out insertNodeBatch Parent not found AppView renderCard hideAllWindows ordering"
Context
Emmy's independent capture for #21087's Round 2 logged two console errors, and they reproduce at
c4e6556490: at 1280×800, sign in, open Mail and Calendar, then sign out.insertNodeBatch: Parent not found {parentId: neo-component-7, index: 4} insertNodeBatch: Parent not found {parentId: neo-component-9, index: 4}neo-component-7andneo-component-9are the two windows'WebDesktop.view.AppViews. With one window open there is one error, and with none there is none.The Problem
Signing out paints the console red, once for each open window. Nothing visible breaks, since the windows are leaving anyway. But the demo is the engine's featured example for 14.0, and an error on its most basic action invites a stranger to distrust everything after it. A console listener in a test would also fail on it.
The Architectural Reality
WebDesktop.view.ViewportController#onSignOutButtonClickcallshideAllWindows()and thensetState({account: null, …})synchronously.hideAllWindows()hides each window insidepromise.then(), so every hide runs one microtask after the state change.AppViewthrough itsaccountbinding.afterSetAccountcallsrenderCard(), which rebuilds the card and callsupdate(). The window is still mounted then, so the update goes out to the VDOM worker.Neo.dialog.Base#hide(false)unmounts a body-level window throughcomponent.Base#unmount(). That sendsremoveNodestraight to the main thread, which applies it before the AppView's update returns. The insert batch then finds no parent.unmount()setsmounted = false,container.Base#afterSetMountedcascades it to the items (#19973), and an update on an unmounted component waits for its next mount (VdomLifecycle#updateVdom).The Fix
onSignOutButtonClickawaitshideAllWindows()before it changes the state, andhideAllWindows()returns the promise of all hides.pendingSignInis still cleared synchronously, so a sign-in reading its arrangement is cancelled at the click, as before.ViewportController.spec.mjsproves the order: every window is hidden before the state changes.Acceptance Criteria
Out of Scope
AppView's full-card rebuild inrenderCard().Avoided Traps
renderCard()for anullaccount. That hides this one trigger, not the ordering: any later state a window's content binds would race the same way.Related
Ownership: self-assigned. It is the next fix in my web desktop lane, stacked on approved PRs, so it is not marked for contributors. Live latest-open + closed sweep: checked latest 20 open + open and closed search ("insertNodeBatch Parent not found", "sign out window unmount update", "Parent not found insertNode"; hits are engine delta work, closed, none on this ordering) at 2026-11-16T04:27Z. No equivalent found. Backlog: 66 open (red); the owning epic is #21061. A2A claim sweep: every unread message read at 04:24Z; no overlapping claim. Emmy, who found the errors, was told at 04:27Z that I take the fix. MC sweep: "insertNodeBatch Parent not found when a window is hidden while its child component re-renders", 10 results; prior art is #19973 (the mounted cascade on a parent's removal), no decision on this ordering. Own-assignment sweep: 13 open, none overlapping.
Origin Session ID: 7ceb0de7-6fcc-4777-879b-3a305deac77f Retrieval Hint: "web desktop sign out insertNodeBatch Parent not found AppView renderCard hideAllWindows ordering"