LearnNewsExamplesServices
Frontmatter
id18920
titleA Chip field destroys the store it was handed
stateClosed
labels
bugai
assigneesneo-opus-ada
createdAtSep 18, 2026, 6:16 PM
updatedAtSep 18, 2026, 6:49 PM
githubUrlhttps://github.com/neomjs/neo/issues/18920
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[x] 18839 ComboBox on a bound store opens empty and filters the shared store
blocking[]
closedAtSep 18, 2026, 6:49 PM

A Chip field destroys the store it was handed

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

Context

@neo-opus-vega found this in her review of PR #18857 (review 5249967127, non-blocking), reading the source. I measured it. #18839 / PR #18857 stops form.field.ComboBox from destroying a store it did not build. Its subclass form.field.Chip still destroys one.

The Problem

Measured on the unit tier at PR #18857's head 4ef5dca5c1. A field is destroyed, and the question is what happens to its store:

Field Store handed as an instance Store built from a config
ComboBox survives destroyed with the field
Chip destroyed destroyed with the field

So a Chip given an app-level store, by instance or through a bind, takes that store down for every other reader when it goes. That is the #18839 defect, one class down.

The Architectural Reality

  • src/form/field/Chip.mjs destroy() ends with super.destroy(...args); !store?.isDestroyed && store?.destroy(). There is no ownership check, although its @summary says the shared store "survives until ComboBox teardown".
  • With PR #18857, ComboBox#destroy() already destroys exactly the stores it built. #owned holds a store made in beforeSetStore from a config or an array. Chip#beforeSetStore returns what super returns, so a store a Chip built itself is in that set too.
  • The line is therefore redundant for an owned store and destroys a handed one.

The Fix

  • Delete the line, and make destroy()'s @summary say what the field tears down.
  • Add unit arms beside #18839's:
    • a Chip handed a store instance leaves it alive;
    • a Chip that built its store from a config takes it down, the control against a leak.

Measured with the line deleted at 4ef5dca5c1: both arms green, both ComboBox controls green, unit/form/field/Chip.spec.mjs 14/14.

Acceptance Criteria

  • AC-1: a Chip handed a store instance leaves that store alive when the Chip is destroyed; red at PR #18857's head.
  • AC-2: a Chip that built its store from a config destroys it with itself.
  • AC-3: Chip.spec.mjs and #18839's shared-store arms stay green.

Out of Scope

  • ComboBox itself, which is #18839.

Avoided Traps

  • A protected ownsStore() accessor on ComboBox for Chip to call, which the review suggested as one route. It is not needed: ComboBox's own teardown already destroys what it owns, so Chip has no second destroy left to guard.

Related

#18839 · PR #18857 · #17312 (Chip as a multi-select over list.Chip)

Blocked by #18839: the ownership this relies on lands with PR #18857.

Live latest-open sweep: latest 20 open issues at 2026-09-18T16:16Z, plus an all-state search for "Chip store destroy": no equivalent. The nearest is #18839 itself. A2A sweep (latest 10, all read-states): no claim on Chip. Own open assignments: none on Chip.

Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59

Retrieval Hint: "Chip destroy shared store ownership ComboBox owned"