LearnNewsExamplesConnect
Frontmatter
assignees[]
createdAtNov 15, 2026, 6:14 AM
updatedAtNov 19, 2026, 3:50 PM
githubUrlhttps://github.com/neomjs/neo/issues/21008
authorneo-gpt-euclid
commentsCount3
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined2
signals[]
blockedBy[]
blocking[]
closedAtNov 19, 2026, 3:50 PM

A raw tree-row batch is lost after re-add and reprojection

Closed v14.0.0/archive-v14-0-0-chunk-2 bughelp wantedgood first issueaicore
neo-gpt-euclid
neo-gpt-euclid commented on Nov 15, 2026, 6:14 AM

Please comment to claim before starting; check current assignees and linked PRs.

Context

A Turbo Mode TreeStore can visibly accept a raw row batch, then restore an older value when the tree reprojects. Found while reviewing #20989; it reproduces on both its base c78adac361a8894d563bbaae800e9fdc5f9621c2 and head 3f32b2283c6f68b59a7c953d328d7c16fcffc467. It is inherited debt, not a blocker introduced by that PR.

Design authority: Store#updateRows writes a held raw row’s own data in place, and TreeStore’s Structural Layer retains the complete population while its visible layer is a projection. A later sort must not undo an accepted value.

The Problem

Using the normal Neo unit setup, Neo plus core exports, TreeStore and a TreeModel with String id/name and Integer score:

const store = Neo.create(TreeStore, {
    autoInitRecords: false,
    model: TestTreeModel,
    data: [
        {id: 'a', name: 'A', score: 1},
        {id: 'b', name: 'B', score: 2}
    ]
});
await store.ready();
store.add({id: 'a', name: 'A readded', score: 1}, false);
store.updateRows([{key: 'a', values: {name: 'A batched'}}]);
// The raw visible row now says 'A batched'. Do not call get() here.
store.sorters = [{property: 'score', reapplyOnRecordChange: true}];
// Reprojection/get now says 'A readded': the batch is lost.
store.destroy();

The source-bound probe loaded complete exact-head Store/RecordFactory/TreeStore modules, checked other imports against each immutable Git tree, and used real instances. Both refs lose the value. The existing hydration repair can hide this: calling get() before reprojecting heals the identity split, so a test that does so misses the raw path.

The Architectural Reality

  • src/data/TreeStore.mjs: Structural Layer, visible projection and re-add/reprojection handoff.
  • src/collection/Base.mjs: keyed replacement and visible item identity.
  • src/data/RecordFactory.mjs: hydration can reconcile the two identities.
  • src/data/Store.mjs: updateRows must keep the raw batch raw.

Closed #17855 corrected duplicate hierarchy entries; PR #18030 explicitly retained stale projection objects as follow-up. #20568 / #20569 heal during hydration and leave Collection replacement semantics outside their scope. None owns this unhydrated batch → reprojection loss.

The Fix

Repair the existing re-add/identity handoff at the owning Collection/TreeStore writer so the current raw row remains authoritative across projection changes. Read those existing methods at intake; no new module or provider is proposed. Preserve the batch’s non-hydrating path and the hierarchy’s key/count invariants.

Contract Ledger Matrix

Surface Authority Required behavior Fallback / docs Evidence
TreeStore re-add/current row TreeStore Structural Layer and Collection keyed replacement One current row/value survives structural and visible projection access Existing API; TreeStore guide Re-add produces the divergence used above
Store#updateRows Its JSDoc / Turbo Mode contract Accepted raw data survives sort/filter reprojection No forced hydration Base and head source-bound reproducer
Hydration RecordFactory and #20568 Continue healing/returning the current identity without being necessary to preserve a batch Existing API get() is a positive masking control, not the fix

Acceptance Criteria

  • The raw re-add → batch → sort sequence retains A batched, with no intervening get() or hydration.
  • Filter reprojection also preserves the current row/value; structural and visible reads agree.
  • Repeated re-add keeps one hierarchy entry per key and correct child/sibling counts.
  • Same-object re-add and hydrated-record paths retain their behavior; raw batch edits hydrate no row.
  • A focused guard fails the named base and passes the fix using the repository’s explicit unit configuration.

Out of Scope

Numeric-parent coercion (#20913 / #20995), the single-edit 401-filter cascade, container migration (#20974), and #20989’s separate dependency-path regression. No grid repaint workaround or new identity registry.

Avoided Traps

Do not call get() merely to make the test pass; do not write the stale Structural Layer while leaving a newer visible row, or the reverse. Preserve one current identity through the existing owner rather than choosing a map per caller.

Ownership / sweeps

unowned-rationale: Ready for a contributor; maintainers provide planning and review. Public source, exact reproducer and acceptance are self-contained; no private service is required. No implementation lane is claimed while Stage #810 is active.

Live latest-open + closed sweep: latest20 open plus all-state TreeStore/re-add/updateRows searches and the complete direct open queue checked; open issue count50 (orange), no matching open owner. #20985/#20989 are positive scope controls; #17855, #18030, #20568 and #20913/#20995 were read for surviving scope/exclusions. Recent all-state A2A claims have no overlap. MC symptom sweep found no owning decision; own-assignment sweep has only unrelated #19058. No epic filing. Decision Record impact: none; repair existing data ownership, no new architectural convention.

Related: #17855, #18030, #20568, #20569, #20968, #20985, #20989. Origin Session ID: be2573b3-54d0-4f1c-8363-ce46c7e1f535 Retrieval Hint: "TreeStore raw re-add row batch value lost after sort reprojection get hydration masks"

yashh1323 cross-referenced by PR #21009 on Nov 15, 2026, 6:53 AM
wanjinhao1
wanjinhao1 Nov 15, 2026, 5:23 PM

I'd like to work on this one.

Plan, against the acceptance criteria as written:

  • Reproduce the re-add → updateRows batch → sorter reprojection sequence from the issue in a unit test, without any intervening get(), asserting A batched survives.
  • Read the re-add/identity handoff in src/data/TreeStore.mjs, src/collection/Base.mjs and src/data/RecordFactory.mjs, then repair the owning writer so the current raw row stays authoritative across structural/visible reprojection, keeping the non-hydrating path and the key/count invariants.
  • Cover the filter reprojection case and repeat re-add as in the ledger, plus the existing hydration behaviour as a positive masking control.

@github-actions - 2026-11-15T16:23:41Z

Thanks, @wanjinhao1! This one is taken: #21009 is open for it.

These good first issue issues are open and nobody holds them:

  • #20883
  • #20890
  • #20903

The full list [QUARANTINED_URL: github.com] has the rest. Comment on one to claim it.

An automatic reply. How claims work [QUARANTINED_URL: github.com]

wanjinhao1 cross-referenced by PR #21035 on Nov 15, 2026, 5:29 PM
wanjinhao1 referenced in commit 17d04e9 - "fix(data): a raw TreeStore batch survives re-add and reprojection (#21008)" on Nov 15, 2026, 5:32 PM