Context
Found while implementing #18839, whose fix gives every bound ComboBox a filtered view over the app's store through sourceId. Measured in the unit tier at dev@3f859a4803, one variable per row:
| # |
Case |
Observed |
| A |
unfiltered sourceId view, source add |
ok |
| B |
filtered sourceId view, source add |
RangeError: Maximum call stack size exceeded |
| C |
filtered plain store, add |
ok |
| D |
filtered plain store, remove of a row the filter hides, then the filter lifted |
the removed row comes back (de,fr,it after removing fr) |
D needs no sourceId: any filtered store resurrects a record removed while hidden.
The Problem
Both rows sit in src/collection/Base.mjs's unfiltered projection (allItems). Since #18273 the projection is written inline by splice (mirrorMutation), and a comment states the contract: "Not a sourceId collection: that would subscribe it to mutate as one listener among others."
- B: the projection is built from
{...me.originalConfig} with filters, items and sorters deleted, but not sourceId. A filtered sourceId collection therefore creates a projection that is itself subscribed to the source, alongside the inline mirror, and the next source mutation never returns.
- D:
me.allItems?.mirrorMutation({addedItems: toAddArray, removedItems}) mirrors the input rows for additions ("the projection filters nothing itself"). For removals it mirrors only what the filtered splice removed, and a row the filter hides is never among those. The sibling bubble to a source in the same method already uses toRemoveArray || removedItems.
The Fix
In src/collection/Base.mjs:
delete config.sourceId beside the other deletions where the projection is built.
removedItems: toRemoveArray || removedItems in the mirrorMutation call.
Acceptance Criteria
Out of Scope
- A filtered collection does not show an
add that matches its filter until the next filter pass. That is the same on dev for plain and derived collections, so it is existing semantics, not this defect.
Related
#18269 / #18273 (the inline mirror this completes) ยท #18839 (depends on it)
Live latest-open sweep: checked the latest 20 open issues at 2026-09-18T11:16:25Z, plus an all-states search for allItems filter sourceId (hits: closed #18269, #8908). No equivalent. Memory Core: pre-#18273 history of allItems as a sourceId listener, and no decision against this. A2A: no claim on collection/Base.
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Context
Found while implementing #18839, whose fix gives every bound ComboBox a filtered view over the app's store through
sourceId. Measured in the unit tier atdev@3f859a4803, one variable per row:sourceIdview, sourceaddsourceIdview, sourceaddRangeError: Maximum call stack size exceededaddremoveof a row the filter hides, then the filter liftedde,fr,itafter removingfr)D needs no
sourceId: any filtered store resurrects a record removed while hidden.The Problem
Both rows sit in
src/collection/Base.mjs's unfiltered projection (allItems). Since #18273 the projection is written inline bysplice(mirrorMutation), and a comment states the contract: "Not asourceIdcollection: that would subscribe it tomutateas one listener among others."{...me.originalConfig}withfilters,itemsandsortersdeleted, but notsourceId. A filteredsourceIdcollection therefore creates a projection that is itself subscribed to the source, alongside the inline mirror, and the next source mutation never returns.me.allItems?.mirrorMutation({addedItems: toAddArray, removedItems})mirrors the input rows for additions ("the projection filters nothing itself"). For removals it mirrors only what the filtered splice removed, and a row the filter hides is never among those. The sibling bubble to a source in the same method already usestoRemoveArray || removedItems.The Fix
In
src/collection/Base.mjs:delete config.sourceIdbeside the other deletions where the projection is built.removedItems: toRemoveArray || removedItemsin themirrorMutationcall.Acceptance Criteria
sourceIdcollection survives its source'sadd. Its projection hassourceId === null, and once the filter lifts the addition is there exactly once.likefilter, value toggled: the shape that reproduces D).test/playwright/unit/collection/AllItemsMirror.spec.mjsand are red ondevfirst. The full unit tier stays green.Out of Scope
addthat matches its filter until the next filter pass. That is the same ondevfor plain and derived collections, so it is existing semantics, not this defect.Related
#18269 / #18273 (the inline mirror this completes) ยท #18839 (depends on it)
Live latest-open sweep: checked the latest 20 open issues at 2026-09-18T11:16:25Z, plus an all-states search for
allItems filter sourceId(hits: closed #18269, #8908). No equivalent. Memory Core: pre-#18273 history ofallItemsas asourceIdlistener, and no decision against this. A2A: no claim on collection/Base.Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59