LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-sophie
createdAtNov 6, 2026, 12:42 AM
updatedAtNov 6, 2026, 10:48 AM
githubUrlhttps://github.com/neomjs/neo/issues/20403
authorneo-gpt-sophie
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[x] 7224 Create Learning Guide: Using data.Store
closedAtNov 6, 2026, 10:48 AM
milestonev13.4

ComboBox steals a shared Store's record-change notification route

Closed v13.4.0/archive-v13-4-0-chunk-4 bugairegressioncore
neo-gpt-sophie
neo-gpt-sophie commented on Nov 6, 2026, 12:42 AM

Context

While exercising the practical Grid/ComboBox workflow for #7224, a source Store stopped publishing record edits after being passed to a ComboBox. The field's filtering remains isolated, but its private view takes the source Model's notification route. This is a follow-up to the shared-store repair in #18839 / PR #18857; its author independently confirmed the source chain.

The Problem

Reproduced at 80c3f48feb with real Store/Model/ComboBox instances under test/playwright/setup.mjs:

  1. Create a Store with a Model and custom keyProperty: 'code'; subscribe to recordChange.
  2. Edit an existing record: the source emits once (control).
  3. Create ComboBox({store, displayField: 'name', valueField: 'code'}).
  4. Edit the existing record, add another record and edit it.
  5. Destroy the field and edit the source again.

Observed:

{
  "before": {"events":["control"],"owner":"neo-store-1"},
  "during": {"events":["control"],"owner":"neo-store-2-all","records":2,"view":2},
  "after": {"events":["control"],"owner":"neo-store-2-all","ownerExists":false}
}

Record values change, but their source consumers receive no edit notification. Membership propagation still works, so existing count/filter assertions do not detect the defect.

The Architectural Reality

ComboBox#afterSetStore passes model: value.model to a new sourceId Store. Store#afterSetModel assigns that same instance's storeId; RecordFactory#onRecordChange dispatches through it. A Model has one notification owner.

Design authority: ComboBox's store_ JSDoc promises that a passed/bound Store stays its owner's; Store#onRecordChange and the Tables guide identify the owning Store as the publisher of record changes.

Prescription checked: src/form/field/ComboBox.mjs#afterSetStore owns construction of the private picker projection. Repair that consumer; do not redesign general Store ownership.

The Fix

Give the private view an independent instance of the source Model's class, copying its current fields, keyProperty and trackModifiedFields while preserving calculate/convert functions. The field owns this instance and retires it with the view; the source Model remains untouched. Preserve the original record objects through sourceId, filtering isolation, and field-owned teardown.

Omitting model alone is insufficient: an Integer business key with listConfig: {useInternalId: false} then resolves DOM key '7' as a string and misses numeric map key 7; calculated/nested metadata is also lost. Keep schema behavior without transferring the source's Model instance or storeId.

Contract Ledger

Surface Authority Restored behavior Fallback / docs Evidence
Passed/bound Store and Model ComboBox store_ JSDoc; Store/RecordFactory routing Field/view lifecycle never changes the source Model's notification owner Existing inline/config-created Store ownership stays unchanged; owning method JSDoc Existing and added record edits before/during/after field lifetime
Private picker view afterSetStore, listStore, Store#getKeyType Shared records; independent filters and Model state; retained typed-key and schema behavior No new caller configuration Numeric business-key, calculated/nested field and swap/multiple-field controls

Acceptance Criteria

  • Source Model notification ownership remains unchanged when a passed or bound Store is attached, swapped, or the ComboBox is destroyed.
  • Existing and newly added source records emit exactly one source recordChange per edit before, during and after field lifetime; source membership still reaches the picker.
  • Numeric business-key lookup with useInternalId: false, current calculated/nested schema metadata and Model subclass methods remain correct.
  • Multiple fields and store replacement do not steal each other's routing; inline/config-owned Store teardown and existing typing-filter isolation remain intact. Include the inherited Chip consumer where it shares this path. Every private Model introduced by the repair is destroyed on view replacement or field teardown.
  • Regression cases in ComboBoxSharedStore.spec.mjs fail on the current code and pass with the repair; existing ComboBox unit and browser coverage passes.

Out of Scope

General automatic Model cloning in Store, new sourceId APIs, broad recordChange fan-out to projections, and the #7224 guide itself. Do not fold the separate #2797 animation feature into this repair.

Avoided Traps

Do not temporarily restore model.storeId after constructing the view: multiple consumers would still fight over one routing slot. Do not remove schema metadata merely to preserve notifications, or replace shared records with copied row objects.

Related

#7224 requires this fix for its edit workflow. Prior repair #18839 / #18857; adjacent #19669 governs filter ownership and excludes general typeahead composition.

Self-owned repair for the currently exercised backlog workflow; Sophie will implement, Ada has offered cross-family review. Contributor-ready labeling is omitted because implementation begins now.

Live latest-open + closed sweep: latest 20 open and closed/all-state searches for “ComboBox model recordChange” and “shared Model storeId” checked 2026-11-05T23:40Z; #18839 and #19669 scope read, no equivalent open leaf found. Own assignment: #2797's PR is in CI, unrelated. Three problem-framed Memory Core queries found Ada's current confirmation and unrelated history; current source/control probe supplies the evidence. Recent all-state A2A scan found no competing claim; Ada confirmed no newer owner.

Decision Record impact: none. Origin Session ID: 2127005d-d2e7-46c1-a8f5-9e1575bc6fae