Context
test/playwright/e2e/grid/CellEditingPickerProjection.spec.mjs:80 (combo, vertical) failed twice on CI today (dev push run 36235273002 at 08a84ef3be; PR #19263 run 36237237140, attempt 1): .neo-picker-container resolved to 2 elements, both id="neo-combobox-1__picker". The failing trace's last DOM snapshot shows both nodes as direct children of <body>. One is aligned (translate(455px, 123.5px), width 141), the other is a fresh, unaligned mount. Locally the arm passes 10/10, and 12/12 at 4x/8x CPU throttling.
The Problem
For a component whose parentId is 'document.body' (every floating picker, menu, tooltip):
component.Base#show() mounts with !me.mounted && me.initVnode(true).
hide() goes through unmount(), which sends removeNode and sets mounted = false at once.
Inside one in-flight initVnode(true), nothing is mounted yet, so the removeNode is a no-op on main, and a second show() still reads mounted === false and starts a second initVnode(true). Both flights insert, and the body holds two nodes with one id. initVnode's own comment leaves single-flight to the caller ("any caller-side single-flight latch"); show() has none. The mirror case, show → hide with nothing after, lands the first flight's node after the removeNode, so a hidden component stays painted.
Reproduced, component tier, empty-viewport fixture: a container mounted at document.body, hidden, then setConfigs({hidden: false}), ({hidden: true}), ({hidden: false}) fired without awaiting → 2 nodes, 5/5 and 3/3. The same sequence with each step awaited → 1 node, 3/3.
The Architectural Reality
mixin.VdomLifecycle#initVnode holds isVnodeInitializing for the whole flight: it is set before the vdom round trip and cleared in onInitVnode or in the catch.
- A parent-rooted component is not affected: its
show() / hide() go through the parent's update, one flight per parent.
- #18290 (the menu re-open race) was a different mechanism: a deferred focus-leave, not a double mount.
The Fix
One mount flight at a time, and the latest intent read when it lands. show() starts initVnode(true) only when nothing is mounted and no flight is in the air, and the flight's settlement unmounts again if hidden turned true meanwhile. hide() during a flight leaves the unmount to that settlement instead of sending a removeNode for a node that does not exist yet.
Acceptance Criteria
Out of Scope
- Ordering between a vdom-worker insert and an app-worker
removeNode after onInitVnode (a separate channel question, not observed here).
- Parent-rooted
show() / hide().
Related
#19263 (the CI red that surfaced it) · #18290 (menu re-open, a different mechanism) · #15083 (parentless initVnode(true) round trip)
Origin Session ID: 81d1894c-d8fd-4192-8350-42e32eb0101e
Retrieval Hint: "document.body floating component show hide show in-flight initVnode two nodes same id picker duplicate"
Context
test/playwright/e2e/grid/CellEditingPickerProjection.spec.mjs:80(combo, vertical) failed twice on CI today (dev push run 36235273002 at08a84ef3be; PR #19263 run 36237237140, attempt 1):.neo-picker-container resolved to 2 elements, bothid="neo-combobox-1__picker". The failing trace's last DOM snapshot shows both nodes as direct children of<body>. One is aligned (translate(455px, 123.5px), width 141), the other is a fresh, unaligned mount. Locally the arm passes 10/10, and 12/12 at 4x/8x CPU throttling.The Problem
For a component whose
parentIdis'document.body'(every floating picker, menu, tooltip):component.Base#show()mounts with!me.mounted && me.initVnode(true).hide()goes throughunmount(), which sendsremoveNodeand setsmounted = falseat once.Inside one in-flight
initVnode(true), nothing is mounted yet, so theremoveNodeis a no-op on main, and a secondshow()still readsmounted === falseand starts a secondinitVnode(true). Both flights insert, and the body holds two nodes with one id.initVnode's own comment leaves single-flight to the caller ("any caller-side single-flight latch");show()has none. The mirror case, show → hide with nothing after, lands the first flight's node after theremoveNode, so a hidden component stays painted.Reproduced, component tier,
empty-viewportfixture: a container mounted atdocument.body, hidden, thensetConfigs({hidden: false}),({hidden: true}),({hidden: false})fired without awaiting → 2 nodes, 5/5 and 3/3. The same sequence with each step awaited → 1 node, 3/3.The Architectural Reality
mixin.VdomLifecycle#initVnodeholdsisVnodeInitializingfor the whole flight: it is set before the vdom round trip and cleared inonInitVnodeor in the catch.show()/hide()go through the parent's update, one flight per parent.The Fix
One mount flight at a time, and the latest intent read when it lands.
show()startsinitVnode(true)only when nothing is mounted and no flight is in the air, and the flight's settlement unmounts again ifhiddenturned true meanwhile.hide()during a flight leaves the unmount to that settlement instead of sending aremoveNodefor a node that does not exist yet.Acceptance Criteria
CellEditingPickerProjectionpasses at the head.Out of Scope
removeNodeafteronInitVnode(a separate channel question, not observed here).show()/hide().Related
#19263 (the CI red that surfaced it) · #18290 (menu re-open, a different mechanism) · #15083 (parentless
initVnode(true)round trip)Origin Session ID: 81d1894c-d8fd-4192-8350-42e32eb0101e Retrieval Hint: "document.body floating component show hide show in-flight initVnode two nodes same id picker duplicate"