Context
Found while diagnosing why #19917's RealWorld v1 fix sometimes left the Popular Tags sidebar empty although /api/tags answered 200: 2 of about 16 natural runs, and 6 of 12 under a later diagnosis harness. A read-only diagnosis of the interleaving traced it to the engine; the app supplies the trigger.
The Problem
A child's update can merge into a parent flight that will never render it, and the child is still acknowledged as done:
- The parent (
HomeComponent) is mounted, gets new data, and starts executeVdomUpdate. It sets isVdomUpdating and yields at src/mixin/VdomLifecycle.mjs:274 (setTimeout(1)); needsVdomUpdate stays true until the payload is built (:610).
- Inside that yield, the child (the tag list) updates.
mergeIntoParentUpdate (:965-966) sees the parent's needsVdomUpdate and registers the child as merged, sets the child's own flag, and returns (:1323-1325).
collectScopes(parent) marks the child collected and claims its promises (:321-322), then recurses. collectScopes(child) returns at :298 because the child's windowId (null) differs from the parent's, so the child gets no scope and no payload, and its flag stays set.
- The parent's depth-1 payload reduces the mounted child to a
neoIgnore placeholder (src/util/vdom/TreeBuilder.mjs:74-80).
resolveVdomUpdate settles the child's claimed callbacks (src/manager/VDomUpdate.mjs:224-226). A promiseUpdate() on the child resolves while its vnode still holds the old content.
End state: the child has needsVdomUpdate set, an old vnode, a newer vdom, and no merged, post-update or in-flight entry left to run it. Nothing re-runs it until something calls update() again. The change is silently lost and reported as done.
The trigger: RealWorld v1's HomeComponent creates TagListComponent in onConstructed with only parentId. Containers forward windowId only to their items (src/container/Base.mjs:319-333, :393), so the tag list keeps windowId: null. On dev the inline vdom embed (#19917) hides the drop, since the tag list rides the parent's payload as plain vdom.
The Architectural Reality
- Merging and collection disagree about eligibility. The merge (
:965) does not check the window, and collection (:298) refuses on it after the merge has already marked and claimed the child.
- The engine's own components forward or pass
windowId to the children they create: grid.Row (#18291), src/functional/component/Base.mjs:137-143, the Time trigger, the grid and table header buttons, the Chip field and the calendar week view.
The Fix
- Engine: in
mergeIntoParentUpdate (:965), merge only when parent.windowId === me.windowId. A mismatched child then runs its own flight, at the cost of one extra worker round trip. The diagnosis ran 2,804 engine-relevant unit specs green both with and without this guard.
- Name the remaining gap: a
windowId that changes after a merge was accepted would still be dropped at :298. Closing that means collection never marks or claims a merged child it will skip, and hands it back as its own flight. That touches what VdomLifecycle.spec.mjs ~961 pins, so it is decided in this ticket's PR or split out with a reason.
- App (#19917):
HomeComponent forwards its windowId to the tag list and passes windowId/appName when it creates the previews.
Acceptance Criteria
Out of Scope
- The app side, which #19917 carries.
Related
#19917 (the trigger) · #19916 / #19921 (the same settlement area) · #18291
Live latest-open sweep: latest 20 open issues at 2026-10-20T16:23Z, plus gh search issues --owner neomjs for "mergeIntoParentUpdate windowId" and "merged child update dropped windowId"; no equivalent
A2A claim sweep: no claim on vdom merging in the window
MC sweep: "child component update merged into parent vdom flight is lost: promiseUpdate resolves but the DOM never shows the change, windowId null", 5 results; January's sibling-race work, a different mechanism; no prior decision
Own-assignment sweep: #19916 and #19921 touch the mount loop, not merging
Retrieval Hint: "mergeIntoParentUpdate windowId mismatch collectScopes drops merged child promiseUpdate resolves"
Origin Session ID: dcd54a9c-cc39-4b54-b3f3-f892704cfa86
Context
Found while diagnosing why #19917's RealWorld v1 fix sometimes left the Popular Tags sidebar empty although
/api/tagsanswered 200: 2 of about 16 natural runs, and 6 of 12 under a later diagnosis harness. A read-only diagnosis of the interleaving traced it to the engine; the app supplies the trigger.The Problem
A child's update can merge into a parent flight that will never render it, and the child is still acknowledged as done:
HomeComponent) is mounted, gets new data, and startsexecuteVdomUpdate. It setsisVdomUpdatingand yields atsrc/mixin/VdomLifecycle.mjs:274(setTimeout(1));needsVdomUpdatestays true until the payload is built (:610).mergeIntoParentUpdate(:965-966) sees the parent'sneedsVdomUpdateand registers the child as merged, sets the child's own flag, and returns (:1323-1325).collectScopes(parent)marks the child collected and claims its promises (:321-322), then recurses.collectScopes(child)returns at:298because the child'swindowId(null) differs from the parent's, so the child gets no scope and no payload, and its flag stays set.neoIgnoreplaceholder (src/util/vdom/TreeBuilder.mjs:74-80).resolveVdomUpdatesettles the child's claimed callbacks (src/manager/VDomUpdate.mjs:224-226). ApromiseUpdate()on the child resolves while its vnode still holds the old content.End state: the child has
needsVdomUpdateset, an old vnode, a newer vdom, and no merged, post-update or in-flight entry left to run it. Nothing re-runs it until something callsupdate()again. The change is silently lost and reported as done.The trigger: RealWorld v1's
HomeComponentcreatesTagListComponentinonConstructedwith onlyparentId. Containers forwardwindowIdonly to theiritems(src/container/Base.mjs:319-333,:393), so the tag list keepswindowId: null. Ondevthe inline vdom embed (#19917) hides the drop, since the tag list rides the parent's payload as plain vdom.The Architectural Reality
:965) does not check the window, and collection (:298) refuses on it after the merge has already marked and claimed the child.windowIdto the children they create:grid.Row(#18291),src/functional/component/Base.mjs:137-143, the Time trigger, the grid and table header buttons, the Chip field and the calendar week view.The Fix
mergeIntoParentUpdate(:965), merge only whenparent.windowId === me.windowId. A mismatched child then runs its own flight, at the cost of one extra worker round trip. The diagnosis ran 2,804 engine-relevant unit specs green both with and without this guard.windowIdthat changes after a merge was accepted would still be dropped at:298. Closing that means collection never marks or claims a merged child it will skip, and hands it back as its own flight. That touches whatVdomLifecycle.spec.mjs~961 pins, so it is decided in this ticket's PR or split out with a reason.HomeComponentforwards itswindowIdto the tag list and passeswindowId/appNamewhen it creates the previews.Acceptance Criteria
windowIddiffers from its owner, updated while the owner's flight is yielding, renders its change, and itspromiseUpdate()resolves only after that. Red ondev({pills: 0, needsVdomUpdate: true, leafSettled: 'resolved'}in the diagnosis), green with the fix. A control arm with matching windowIds passes on both.dev.windowId-change gap from The Fix is closed, or carried out with its reason.Out of Scope
Related
#19917 (the trigger) · #19916 / #19921 (the same settlement area) · #18291
Live latest-open sweep: latest 20 open issues at 2026-10-20T16:23Z, plus
gh search issues --owner neomjsfor "mergeIntoParentUpdate windowId" and "merged child update dropped windowId"; no equivalent A2A claim sweep: no claim on vdom merging in the window MC sweep: "child component update merged into parent vdom flight is lost: promiseUpdate resolves but the DOM never shows the change, windowId null", 5 results; January's sibling-race work, a different mechanism; no prior decision Own-assignment sweep: #19916 and #19921 touch the mount loop, not mergingRetrieval Hint: "mergeIntoParentUpdate windowId mismatch collectScopes drops merged child promiseUpdate resolves" Origin Session ID: dcd54a9c-cc39-4b54-b3f3-f892704cfa86