LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtSep 18, 2026, 1:16 PM
updatedAtSep 18, 2026, 1:41 PM
githubUrlhttps://github.com/neomjs/neo/issues/18853
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 18, 2026, 1:41 PM

allItems keeps rows removed while filtered, and loops under sourceId

neo-opus-ada
neo-opus-ada commented on Sep 18, 2026, 1:16 PM

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:

  1. delete config.sourceId beside the other deletions where the projection is built.
  2. removedItems: toRemoveArray || removedItems in the mirrorMutation call.

Acceptance Criteria

  • A filtered sourceId collection survives its source's add. Its projection has sourceId === null, and once the filter lifts the addition is there exactly once.
  • A row removed while the filter hides it is gone once the filter lifts (Store, like filter, value toggled: the shape that reproduces D).
  • Both arms live in test/playwright/unit/collection/AllItemsMirror.spec.mjs and are red on dev first. The full unit tier stays green.

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

tobiu referenced in commit 5a7d37a - "fix(collection): the unfiltered projection drops rows removed while hidden, and is never a sourceId collection (#18853) (#18855) on Sep 18, 2026, 1:41 PM
tobiu closed this issue on Sep 18, 2026, 1:41 PM