Context
Surfaced 2026-09-18 by the Institution's FleetGridScaleNL arm at engine dev@3f859a4803: the scenario passes, and the worker-error fixture (#18554) reports
App Worker: TypeError: Cannot read properties of undefined (reading 'style')
at src/list/plugin/Animate.mjs:645:30 (removedItems.forEach, inside onStoreFilter's timeout)The throw is the loud end of a quiet defect that has been there as long as the method.
The Problem
onStoreFilter splices the added rows into vdom.cn first, waits 50 ms, then fades the removed rows. Outside an interception it resolves a removed row by obj.index — its index in data.oldItems — against a vdom.cn that already holds the added rows:
- old
[alpha, bravo, delta], new [charlie, echo] → vdom.cn = [charlie, echo, alpha, bravo, delta]; the removed rows' old indexes 0/1/2 hit charlie, echo, alpha. The entering rows fade out, two leaving rows stay fully visible until the settle pass rebuilds the list.
- If anything rebuilt
vdom.cn inside those 50 ms (a store load, a sort), the old index points past its end → the TypeError above. The added-rows loop two blocks up reads vdom.cn[index].style by position the same way.
Removals-only passes (the common narrowing filter) are correct by coincidence: old index equals vdom index.
Found while writing the arms: the by-id lookup itself derives the item id from the record KEY (owner.getItemId(obj.record[key]), also in the reAdded check), while a list with the default useInternalId: true builds its item ids from store.getInternalId(record). On such a list the lookup never matches — which is why the moved-rows loop silently does nothing there. The rest of the file already derives it correctly (owner.getItemId(owner.getRecordId(record))).
Found by this ticket's own arms in CI: triggerTransitionCallback arms a raw setTimeout and destroy() never clears it. A list destroyed inside a transition leaves the timer running; it fires on a plugin whose owner is gone — TypeError: Cannot read properties of null (reading 'createItems') at Animate.mjs:773 — inside whichever code runs next (in the unit tier: the next test, which is how it showed up as a flake on the first push).
The Architectural Reality
src/list/plugin/Animate.mjs — onStoreFilter (:554), getItemIndex(obj, map, intercept) (:448): intercept false → positional obj.index; true → map.indexOf(owner.getItemId(key)). Inside the timeout the method rebuilds map from the live vdom.cn precisely because "new items are already added into the vdom, while old items are not yet removed", and the moved-rows loop already passes true ("honor removed items, even without interceptions"). The added and removed loops beside it do not.
The Fix
Inside the timeout callback all three loops resolve by id (getItemIndex(obj, map, true)): a row is found where it is, and a row that is gone answers -1 and is skipped. The id comes from owner.getRecordId(record), so internal-id and key-id lists resolve alike. The positional read stays where it is correct — the pre-timeout splice, which needs the insertion index.
Acceptance Criteria
Out of Scope
The interception path's own index logic; the sort path (onStoreSort); measured row height.
Avoided Traps
Guarding vdom.cn[index]?.style silences the throw and keeps fading the wrong rows.
Related
#18554 (the fixture that made it visible) · #18604 (last change to this plugin) · neomjs/neo-agent-institution#151 (the consumer pin that surfaced it)
Decision Record impact: none.
Live latest-open sweep: latest 20 open issues read at 2026-09-18T10:56Z + an all-state search (Animate plugin filter removed index) — nothing equivalent (#17554 is list.Buffered windowing). A2A sweep: latest 50 messages, no claim on this file. Memory Core: problem-keyed query returned only my own #18604 design turn and unrelated grid animation history — no prior decision. Own open assignments (#12964, #15000, #15243, #16742): no overlap.
Origin Session ID: 1ef6c04a-10f6-4977-ad7d-0e2c7f343c59
Retrieval Hint: "Animate plugin onStoreFilter removed rows positional index vdom.cn already holds added rows wrong row fades"
Context
Surfaced 2026-09-18 by the Institution's
FleetGridScaleNLarm at enginedev@3f859a4803: the scenario passes, and the worker-error fixture (#18554) reportsApp Worker: TypeError: Cannot read properties of undefined (reading 'style') at src/list/plugin/Animate.mjs:645:30 (removedItems.forEach, inside onStoreFilter's timeout)The throw is the loud end of a quiet defect that has been there as long as the method.
The Problem
onStoreFiltersplices the added rows intovdom.cnfirst, waits 50 ms, then fades the removed rows. Outside an interception it resolves a removed row byobj.index— its index indata.oldItems— against avdom.cnthat already holds the added rows:[alpha, bravo, delta], new[charlie, echo]→vdom.cn = [charlie, echo, alpha, bravo, delta]; the removed rows' old indexes 0/1/2 hitcharlie,echo,alpha. The entering rows fade out, two leaving rows stay fully visible until the settle pass rebuilds the list.vdom.cninside those 50 ms (a store load, a sort), the old index points past its end → theTypeErrorabove. The added-rows loop two blocks up readsvdom.cn[index].styleby position the same way.Removals-only passes (the common narrowing filter) are correct by coincidence: old index equals vdom index.
Found while writing the arms: the by-id lookup itself derives the item id from the record KEY (
owner.getItemId(obj.record[key]), also in thereAddedcheck), while a list with the defaultuseInternalId: truebuilds its item ids fromstore.getInternalId(record). On such a list the lookup never matches — which is why the moved-rows loop silently does nothing there. The rest of the file already derives it correctly (owner.getItemId(owner.getRecordId(record))).Found by this ticket's own arms in CI:
triggerTransitionCallbackarms a rawsetTimeoutanddestroy()never clears it. A list destroyed inside a transition leaves the timer running; it fires on a plugin whose owner is gone —TypeError: Cannot read properties of null (reading 'createItems')atAnimate.mjs:773— inside whichever code runs next (in the unit tier: the next test, which is how it showed up as a flake on the first push).The Architectural Reality
src/list/plugin/Animate.mjs—onStoreFilter(:554),getItemIndex(obj, map, intercept)(:448):interceptfalse → positionalobj.index; true →map.indexOf(owner.getItemId(key)). Inside the timeout the method rebuildsmapfrom the livevdom.cnprecisely because "new items are already added into the vdom, while old items are not yet removed", and the moved-rows loop already passestrue("honor removed items, even without interceptions"). The added and removed loops beside it do not.The Fix
Inside the timeout callback all three loops resolve by id (
getItemIndex(obj, map, true)): a row is found where it is, and a row that is gone answers-1and is skipped. The id comes fromowner.getRecordId(record), so internal-id and key-id lists resolve alike. The positional read stays where it is correct — the pre-timeout splice, which needs the insertion index.Acceptance Criteria
test/playwright/unit/list/animatePlugin.spec.mjs): a filter pass that swaps the visible set fades exactly the leaving rows (opacity 0) and shows exactly the entering ones (opacity 1) during the transition.filtering fades removed items out…,component-list filtering settles…) stay green.Out of Scope
The interception path's own index logic; the sort path (
onStoreSort); measured row height.Avoided Traps
Guarding
vdom.cn[index]?.stylesilences the throw and keeps fading the wrong rows.Related
#18554(the fixture that made it visible) ·#18604(last change to this plugin) · neomjs/neo-agent-institution#151 (the consumer pin that surfaced it)Decision Record impact: none.
Live latest-open sweep: latest 20 open issues read at 2026-09-18T10:56Z + an all-state search (
Animate plugin filter removed index) — nothing equivalent (#17554is list.Buffered windowing). A2A sweep: latest 50 messages, no claim on this file. Memory Core: problem-keyed query returned only my own#18604design turn and unrelated grid animation history — no prior decision. Own open assignments (#12964,#15000,#15243,#16742): no overlap.Origin Session ID: 1ef6c04a-10f6-4977-ad7d-0e2c7f343c59 Retrieval Hint: "Animate plugin onStoreFilter removed rows positional index vdom.cn already holds added rows wrong row fades"