LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-julia
createdAtNov 3, 2026, 8:25 PM
updatedAtNov 4, 2026, 1:20 PM
githubUrlhttps://github.com/neomjs/neo/issues/20267
authorneo-gemini-julia
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 4, 2026, 1:20 PM

Store#filter and Store#isFilteredItem skip soft hydration for a filterBy filter without a value

Closed v13.4.0/archive-v13-4-0-chunk-3 bugaiai-generated
neo-gemini-julia
neo-gemini-julia commented on Nov 3, 2026, 8:25 PM

Design authority: src/collection/Filter.mjs:115-118 (Filter#effective) and src/collection/Base.mjs:1601 (Collection#splice), introduced in #19792 / #19796 and mirrored in TreeStore#filter (#20258 / PR #20259).

Context

Promoted from defect-note (MESSAGE:aa316289-880e-4cc4-86a3-afdf047f35f2, observed by @neo-opus-grace while reviewing #20259).

Neo.collection.Filter#effective (src/collection/Filter.mjs:115-118) defines whether a filter actively narrows a collection:

  • When a filterBy callback is configured, the filter is effective whenever !this.disabled.
  • Otherwise, it is effective when !this.disabled && this.value !== null.

While Collection#splice (src/collection/Base.mjs:1601) and TreeStore#filter (#20258 / PR #20259) gate on Filter#effective, Neo.data.Store still gates its Turbo-Mode (autoInitRecords: false) soft-hydration passes on the pre-#19792 predicate !f.disabled && f.value !== null.

The Problem

In src/data/Store.mjs:

  1. Store#filter() (src/data/Store.mjs:732) selects activeFilters via:
       activeFilters = me.filters.filter(f => !f.disabled && f.value !== null),
  2. Store#isFilteredItem() (src/data/Store.mjs:1114) gates per-item soft hydration via:
       if (!filter.disabled && filter.value !== null) {

When a Store runs in Turbo Mode (autoInitRecords: false) with a Model that has complex fields (calculate, convert, or mapping), and an enabled filterBy filter declares fields without setting value (value: null), both Store#filter() and Store#isFilteredItem() skip soft hydration for that filter's fields. The filterBy callback then still runs inside Filter.isFiltered() (src/collection/Filter.mjs:146-152), reading undefined for those unhydrated fields on raw items.

The Architectural Reality

  • Filter#effective (src/collection/Filter.mjs:115-118) is the single source of authority for whether a Filter instance is active.
  • Store#filter() (src/data/Store.mjs:732) and Store#isFilteredItem() (src/data/Store.mjs:1114) should gate on f.effective / filter.effective so Turbo-Mode soft hydration resolves fields for every effective filter before super.filter(silent) or super.isFilteredItem(item) evaluates Filter.isFiltered().

The Fix

  1. In src/data/Store.mjs:
    • Line 732 (Store#filter): replace !f.disabled && f.value !== null with f.effective.
    • Line 1114 (Store#isFilteredItem): replace !filter.disabled && filter.value !== null with filter.effective.
  2. In test/playwright/unit/data/StoreFilter.spec.mjs (or existing Store unit spec):
    • Add unit test coverage verifying that in a Turbo-Mode Store (autoInitRecords: false) with a calculated model field, an enabled filterBy filter declaring fields: [' doubled'] without a value soft-hydrates doubled on raw items during both store.filter() and store.isFilteredItem(rawItem).

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Neo.data.Store#filter (src/data/Store.mjs:732) Neo.collection.Filter#effective (src/collection/Filter.mjs:115-118) Selects activeFilters via f => f.effective Inert filters (disabled: true or no filterBy and value === null) are skipped JSDoc in src/data/Store.mjs Playwright unit spec
Neo.data.Store#isFilteredItem (src/data/Store.mjs:1114) Neo.collection.Filter#effective (src/collection/Filter.mjs:115-118) Gates per-item soft hydration via if (filter.effective) Inert filters are skipped JSDoc in src/data/Store.mjs Playwright unit spec

Decision Record impact: none.

Acceptance Criteria

  • Store#filter (src/data/Store.mjs:732) selects activeFilters using f => f.effective.
  • Store#isFilteredItem (src/data/Store.mjs:1114) gates per-item soft hydration using if (filter.effective).
  • Unit tests verify that a Turbo-Mode Store (autoInitRecords: false) with a calculated model field soft-hydrates fields declared on a filterBy filter with value: null in both filter() and isFilteredItem(rawItem).

Out of Scope

  • Modifying Filter#effective or TreeStore#filter (covered by #19792 and #20258 / PR #20259).

Avoided Traps

  • Duplicating f.filterBy ? !f.disabled : (!f.disabled && f.value !== null) inline in Store.mjs instead of delegating to Filter#effective.

Related

  • #19792 / PR #19796: introduced Filter#effective and Filter#fields.
  • #20258 / PR #20259: fixed the same predicate in TreeStore#filter.

Live latest-open sweep: checked latest 20 open issues at 2026-11-03T19:24Z; no equivalent found (#20258 scopes TreeStore#filter only). A2A in-flight claim sweep: checked list_messages({ status: 'all', limit: 30 }) at 2026-11-03T19:24Z; promoting MESSAGE:aa316289-880e-4cc4-86a3-afdf047f35f2 with no competing claim. Memory Core rationale sweep: query_raw_memories (Store#filter Store#isFilteredItem Filter#effective filterBy without a value Turbo Mode autoInitRecords) and ask_knowledge_base (type: 'ticket') returned #19792/#19643 context and no prior exclusion. Own-assignment sweep: checked gh issue list --state open --assignee @me (#20264, #20260, #20258, #20256); #20258 is the TreeStore sibling.

unowned-rationale: Claimed by @neo-gemini-julia for immediate execution.

Origin Session ID: 50cec9b3-cbdc-4b13-befe-10aaa76a14d1

Retrieval Hint: "Store#filter Store#isFilteredItem Filter#effective filterBy without value Turbo Mode soft hydration"

tobiu referenced in commit 4e23a23 - "fix(data): Store#filter and Store#isFilteredItem gate soft hydration via Filter#effective (#20267) (#20268)" on Nov 4, 2026, 1:20 PM
tobiu closed this issue on Nov 4, 2026, 1:20 PM