Skip to content

seed: a single-field externalId record whose key value is missing inserts another row on every load, with no warning (sibling of #34857) #35336

Closed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CaysxGzF62ACvZ1x9x

Filing gate: ② out-of-scope finding (class b, named producer): the decision analysis for #34857 (area pkg-1 of seat repo:objectstack#5, file objectstack-seat5/area-ux/pkg-1/decision-34857.md), measured on origin/main 81c09477. Filed on the seat's word (2026-11-19T05:19Z): stock count first, file if real. ⛔ Not a claim.
Reader: domain:server (packages/metadata-protocol/src/seed-loader.ts). Suggested-grade: p2 · same family and grade as #34857 and #34613.
Dedupe: seed single externalId missing value duplicate, externalIdKey empty record inserted every load in open issues: only #34857 (composite keys, ruled B1).

维护者速读

What happens

A seed dataset keyed on one field (externalId: 'code', or the default name) where one record has no value for that field (undefined, null or '') while other records carry it. externalIdKey (seed-loader.ts:5351) answers '' for that record, so it matches no stored row and is inserted again on every load. The #28952 warning (seed-loader.ts ~:1803-1811) fires only when EVERY record keys empty, so nothing is said.

Measured with the faithful in-memory engine of seed-loader-empty-key-warn.test.ts, three loads of [{ name: 'A', code: 'a' }, { name: 'B' }] keyed on code: row count 2 → 3 → 4, zero warnings. CONTROL (both records keyed): 2 → 2 → 2.

seed-loader-empty-key-warn.test.ts:172 ("a dataset where some record carries the key is not warned about") pins the silence for one load; a fix flips it.

Expected

The same rule Bill ruled for composite keys on #34857 (B1, ruling 7000515976) unless the maintainer says otherwise: at load, the one record with no key value is not written, the load result carries an error naming the object, record index, key field and the fix; other records and datasets load. A deferred reference (authored, resolves empty) is not caught: the check reads the key before references resolve.

Stock (read 2026-11-19T05:25Z)

26 authored seed datasets (examples/app-showcase 20, app-crm 5, app-todo 1), every one with an explicit externalId and every record carrying it: 0 affected. Whitespace-only values are counted as keys (no trim) — not in scope. Hosted / customer stacks not read.

Related: #34857 (composite, ruled B1), #28952 (all-empty warning), #34613 (unkeyed seeds), #34856.

Activity

  1. added
    priority:p2
    pm:queue
    finding
    domain:server
    on Nov 19, 2026
  2. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

    Seat ruling record · 2026-11-19T05:25Z

    Ruling-ref: maintainer 2026-11-19T05:24Z on seat 5's decision card for #35336, option chosen verbatim: 「是,和 #34857 一起做」. It extends ruling 7000515976 on #34857 (B1) to single-field keys.

    Execution (area pkg-1): a seed record whose single-field externalId is blank (empty string, null, or omitted) is refused at load the same way as a blank composite-key component: not written, one error naming the object, record index, key field and fix; other records load. Folded with #34857 into one PR (same rule, same check, same file), after #34856 lands. Stock: 0 of 26 authored seed datasets in the repo are affected.

  3. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CaysxGzF62ACvZ1x9x

    Claim: PM loop round 5 · area pkg-1 · fold member of chain head #34857 (claim on #34857 carries the full serial-constraints check and the five fold gates) · 2026-11-19T07:28Z
    Session: session_01Utp6CaysxGzF62ACvZ1x9x
    Account: os-bill
    Area: pkg-1
    Branch: claude/issue-34857-blank-seed-key-refused
    Domain: domain:server
    Seat: repo:objectstack#5
    Clause-②: no (narrowing)
    Metadata-protocol: narrowed
    Thread-read: 7000600379

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  5. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CaysxGzF62ACvZ1x9x

    Close-out 2026-11-19T16:22Z: delivered by PR #35459 (MERGED de395b428d, folded under #34857; the land gate takes one Fixes, so this card closes by hand). A single-field externalId record whose key value is missing, null or blank is now refused in keyed modes with a named diagnostic instead of inserting another row on each load; pinned in seed-loader-empty-key-warn.test.ts. pm:dispatched and lease:pkg-1 off; closed as completed.

  6. removed
    pm:dispatched
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:packagedomain:serverfindingpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions