Context
Found by @neo-opus-grace while reviewing #18901: createNeoInstance with parentId: undefined ended in RangeError inside GridBody.mergeIntoParentUpdate. Reproduced in the unit tier on dev@6d61d8a900. A Component created with parentId: undefined keeps undefined (the config default 'document.body' does not replace an explicit undefined), and for its child both walks throw:
mergeIntoParentUpdate() โ RangeError: Maximum call stack size exceeded
isParentUpdating() โ RangeError: Maximum call stack size exceeded
The Problem
VdomLifecycle#isParentUpdating(parentId=this.parentId, resolve, distance=1) and #mergeIntoParentUpdate(parentId=this.parentId, distance=1) walk up by recursing with parent.parentId. The default parameter is meant for the first call only. But a recursion that passes an ancestor's undefined takes the default again, restarts from the component's own parentId, and walks the same chain forever. Every update of a component below such an ancestor then throws, since update() calls mergeIntoParentUpdate() first.
The Architectural Reality
src/mixin/VdomLifecycle.mjs: the two walks (:749, :794), and their callers in updateVdom's path (mergeIntoParentUpdate(parentId), then isParentUpdating(parentId, resolve)).
- A walk ends at
'document.body' or at an id that resolves to no component. An undefined id is neither, because the default parameter turns it back into this.parentId.
- No other
src method recurses with a this-derived default parameter.
The Fix
Both walks pass the next id as parent.parentId ?? null. A null argument takes no default, resolves to no component, and ends the walk as a missing ancestor does today.
Acceptance Criteria
Out of Scope
- Whether a Component may be created with
parentId: undefined at all.
Related
#18899 ยท #18901 (the review that found it)
Decision Record impact: none.
Live latest-open sweep: the latest 20 open issues at 2026-09-18T15:28Z, and an all-state search for isParentUpdating, mergeIntoParentUpdate and Maximum call stack: no equivalent. A2A: @neo-opus-grace suggested the ticket and did not claim it.
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Retrieval Hint: "VdomLifecycle isParentUpdating mergeIntoParentUpdate default parameter this.parentId undefined ancestor infinite recursion RangeError"
Context
Found by @neo-opus-grace while reviewing #18901:
createNeoInstancewithparentId: undefinedended inRangeErrorinsideGridBody.mergeIntoParentUpdate. Reproduced in the unit tier ondev@6d61d8a900. A Component created withparentId: undefinedkeepsundefined(the config default'document.body'does not replace an explicitundefined), and for its child both walks throw:The Problem
VdomLifecycle#isParentUpdating(parentId=this.parentId, resolve, distance=1)and#mergeIntoParentUpdate(parentId=this.parentId, distance=1)walk up by recursing withparent.parentId. The default parameter is meant for the first call only. But a recursion that passes an ancestor'sundefinedtakes the default again, restarts from the component's ownparentId, and walks the same chain forever. Every update of a component below such an ancestor then throws, sinceupdate()callsmergeIntoParentUpdate()first.The Architectural Reality
src/mixin/VdomLifecycle.mjs: the two walks (:749,:794), and their callers inupdateVdom's path (mergeIntoParentUpdate(parentId), thenisParentUpdating(parentId, resolve)).'document.body'or at an id that resolves to no component. Anundefinedid is neither, because the default parameter turns it back intothis.parentId.srcmethod recurses with athis-derived default parameter.The Fix
Both walks pass the next id as
parent.parentId ?? null. Anullargument takes no default, resolves to no component, and ends the walk as a missing ancestor does today.Acceptance Criteria
parentIdisundefined, both walks returnfalseinstead of throwing, witnessed by a unit arm that is red without the fix.Out of Scope
parentId: undefinedat all.Related
#18899 ยท #18901 (the review that found it)
Decision Record impact: none.
Live latest-open sweep: the latest 20 open issues at 2026-09-18T15:28Z, and an all-state search for
isParentUpdating,mergeIntoParentUpdateandMaximum call stack: no equivalent. A2A: @neo-opus-grace suggested the ticket and did not claim it.Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59 Retrieval Hint: "VdomLifecycle isParentUpdating mergeIntoParentUpdate default parameter this.parentId undefined ancestor infinite recursion RangeError"