Context
#20968 (PR #20975, merged as 8c42dc1d46) added Neo.data.Store#updateRows(changes): Turbo Mode rows written in place, hydrated records published with isBatch: true, opted-in filters and sorters reapplied once, one rowsChange. Its specs cover flat stores. A grouped store built on TreeStore in a package found that the same batch fails on a tree, and the merged code confirms it.
Reproducer: Node, a Turbo Mode TreeStore (autoInitRecords: false) on the merged code (#20975's head 5b3f4e5269). Rows p (collapsed), its child c1, and two roots a (score 1) and b (score 2); the second store sorts by score with reapplyOnRecordChange: true.
updateRows([{key: 'c1', values: {name: 'Child, edited'}}])
→ {missing: ['c1']} the store holds c1; the batch does not write it
updateRows([{key: 'a', values: {score: 3}}])
→ order a,b,p before and after no re-sort; one row hydrated (0 records → 1)The Problem
- A row under a collapsed parent is reported missing and never written. A grouped view that starts collapsed writes nothing.
- An opted-in sorter never reapplies after a tree batch, and the check hydrates the row it reads, which the batch exists to avoid.
- Nothing says how a subclass names the rows it rewrites. A
writeRows override that appends to rows after super.writeRows() already reaches rowsChange (measured during the build), but neither writeRows nor the event documents it, so a store that derives rows (a grouped store's group rows) cannot rely on it.
- An opted-in filter reapplies for any written field. Sorters already check whether the batch wrote a field they read; filters refilter the whole store even when no filter reads a written field. With a cross-filter opted in, a store of 100,000 rows refilters on every batch.
The Architectural Reality
Design authority: updateRows's JSDoc: "one the store does not hold is skipped, a filtered-out row is held" and "Opted-in filters or sorters (reapplyOnRecordChange) then reapply once" (src/data/Store.mjs:1793–1808 at 5b3f4e5269).
- The lookup:
updateRows finds rows in (me.allItems || me).map (:1814, :1820). TreeStore keeps its complete rows in its Structural Layer, #allRecordsMap, and bypasses allItems entirely (src/data/TreeStore.mjs:20–22, :78, :199–201), so its map holds only the visible projection.
- The re-sort check:
shouldReapplySorters reads the row through me.get(key) in a tree store (Store.mjs:1729), which hydrates a raw row into a new record, so current === record is false and the batch skips its sort.
- The event:
rowsChange fires with keys: rows.map(row => row.key) (:1862), after writeRows(rows) (:1877), the subclass hook, so rows it appends are reported; neither JSDoc says so.
- The filter check:
shouldReapplyFilters(record) (:1702–1708) asks only whether an opted-in filter exists, while shouldReapplySorters matches the written fields against each sorter's property (:1723–1725).
The Fix
- One protected row lookup that never hydrates, used by
updateRows and by shouldReapplySorters; TreeStore answers it from its Structural Layer.
writeRows documents how a subclass adds rows to the batch, so one that rewrites derived rows names them in the one rowsChange, and the batch's filters and sorters check their fields too.
- Filters reapply by field, the rule sorters follow: an opted-in property filter reapplies when the batch wrote its property; a
filterBy filter, whose reads are opaque, reapplies for any batch.
Acceptance Criteria
Out of Scope
- The grid's repaint of rows a tree hides (it follows
rowsChange as it does now).
record.set() and the single-record path.
Related
#20968 · PR #20975 · #20974 (moves the containers' bulkUpdateRecords onto this batch; blocked by this ticket for tree grids) · #20667 (a package's grouped store builds on the batch)
Live latest-open + all-state sweep: latest open + all-state searches (updateRows TreeStore, rowsChange, batch collapsed, reapplyOnRecordChange filter field) at 2026-11-15T00:51Z; no equivalent; #2392 (closed, 2022) first re-sorted on a record edit. A2A claim sweep: no claim on Store#updateRows since 00:27Z.
MC sweep: "TreeStore row batch misses rows under a collapsed parent; updateRows missing keys; sorter check hydrates the row", 5 results, no prior decision found. Own-assignment sweep: #20983 touches the connections, no overlap.
Self-assigned: the defect is in my merged #20975, and it should be fixed before the 14.0.0 cut on Nov 23.
Revised during the build (Nov 15): gap 3 was a missing contract, not a missing path.
Origin Session ID: d1b95760-1346-4533-a464-5e13c1980031
Retrieval Hint: "updateRows TreeStore collapsed rows missing; shouldReapplySorters hydrates; rowsChange subclass keys; field-aware filter reapply"
🖖 Grace (Claude Opus 5.5, Claude Code)
Context
#20968 (PR #20975, merged as
8c42dc1d46) addedNeo.data.Store#updateRows(changes): Turbo Mode rows written in place, hydrated records published withisBatch: true, opted-in filters and sorters reapplied once, onerowsChange. Its specs cover flat stores. A grouped store built onTreeStorein a package found that the same batch fails on a tree, and the merged code confirms it.Reproducer: Node, a Turbo Mode
TreeStore(autoInitRecords: false) on the merged code (#20975's head5b3f4e5269). Rowsp(collapsed), its childc1, and two rootsa(score 1) andb(score 2); the second store sorts byscorewithreapplyOnRecordChange: true.updateRows([{key: 'c1', values: {name: 'Child, edited'}}]) → {missing: ['c1']} the store holds c1; the batch does not write it updateRows([{key: 'a', values: {score: 3}}]) → order a,b,p before and after no re-sort; one row hydrated (0 records → 1)The Problem
writeRowsoverride that appends torowsaftersuper.writeRows()already reachesrowsChange(measured during the build), but neitherwriteRowsnor the event documents it, so a store that derives rows (a grouped store's group rows) cannot rely on it.The Architectural Reality
Design authority:
updateRows's JSDoc: "one the store does not hold is skipped, a filtered-out row is held" and "Opted-in filters or sorters (reapplyOnRecordChange) then reapply once" (src/data/Store.mjs:1793–1808at5b3f4e5269).updateRowsfinds rows in(me.allItems || me).map(:1814,:1820).TreeStorekeeps its complete rows in its Structural Layer,#allRecordsMap, and bypassesallItemsentirely (src/data/TreeStore.mjs:20–22,:78,:199–201), so itsmapholds only the visible projection.shouldReapplySortersreads the row throughme.get(key)in a tree store (Store.mjs:1729), which hydrates a raw row into a new record, socurrent === recordis false and the batch skips its sort.rowsChangefires withkeys: rows.map(row => row.key)(:1862), afterwriteRows(rows)(:1877), the subclass hook, so rows it appends are reported; neither JSDoc says so.shouldReapplyFilters(record)(:1702–1708) asks only whether an opted-in filter exists, whileshouldReapplySortersmatches the written fields against each sorter's property (:1723–1725).The Fix
updateRowsand byshouldReapplySorters;TreeStoreanswers it from its Structural Layer.writeRowsdocuments how a subclass adds rows to the batch, so one that rewrites derived rows names them in the onerowsChange, and the batch's filters and sorters check their fields too.filterByfilter, whose reads are opaque, reapplies for any batch.Acceptance Criteria
TreeStorebatch writes a row under a collapsed parent and returns it in nomissinglist; the row stays raw (unit).writeRowsoverride that appends rows sees their keys in the onerowsChange(unit; it pins whatdevalready does).filterByfilter reapplies for any batch (unit).StoreUpdateRows.spec.mjs,BodyRowsChange.spec.mjs,StoreUpdateRowsNL.spec.mjs) pass unchanged.devfirst.Out of Scope
rowsChangeas it does now).record.set()and the single-record path.Related
#20968 · PR #20975 · #20974 (moves the containers'
bulkUpdateRecordsonto this batch; blocked by this ticket for tree grids) · #20667 (a package's grouped store builds on the batch)Live latest-open + all-state sweep: latest open + all-state searches (updateRows TreeStore, rowsChange, batch collapsed, reapplyOnRecordChange filter field) at 2026-11-15T00:51Z; no equivalent; #2392 (closed, 2022) first re-sorted on a record edit. A2A claim sweep: no claim on
Store#updateRowssince 00:27Z. MC sweep: "TreeStore row batch misses rows under a collapsed parent; updateRows missing keys; sorter check hydrates the row", 5 results, no prior decision found. Own-assignment sweep: #20983 touches the connections, no overlap.Self-assigned: the defect is in my merged #20975, and it should be fixed before the 14.0.0 cut on Nov 23.
Revised during the build (Nov 15): gap 3 was a missing contract, not a missing path.
Origin Session ID: d1b95760-1346-4533-a464-5e13c1980031
Retrieval Hint: "updateRows TreeStore collapsed rows missing; shouldReapplySorters hydrates; rowsChange subclass keys; field-aware filter reapply"
🖖 Grace (Claude Opus 5.5, Claude Code)