Commit 40e8653
`duplicatePackage`'s source-row scan deduped the scanned `sys_metadata` rows
with a NUL-separated key built from the row's `type` and `name` only, keeping
the org-scoped row over the env-wide one. That key is `(type, name)` with no
discriminator, so for a type whose identity the spec declares as a pair it
collapsed two rows that are two different things.
`EmailTemplateDefinitionSchema` declares such a type: rows sharing a `name` but
differing in `locale` form an i18n bundle resolved by `(name, locale)`. Within
one org the collapse cannot happen — overlay uniqueness is
`(type, name, organization_id, package_id)` and the table has no locale column
— but across the env-wide and org tiers it can, and this scan is where the two
tiers meet. An env-wide `auth.welcome` in `en-US` plus an org `auth.welcome` in
`zh-CN` are two members of one bundle; the duplicate shipped one of them and
reported success.
Append the canonical-normalized discriminator when the type declares one and
nothing otherwise — the shape #7774 gave `metaItemKey` — so every
undiscriminated type keeps a byte-identical two-component key. Precedence is
unchanged where it was ever meaningful: an org row still overrides the env-wide
row of the same member.
Claude-Session: https://claude.ai/code/session_01553EtKW75AGxDcCMyqkSEs
Co-authored-by: Claude <noreply@anthropic.com>
1 parent c7e7900 commit 40e8653
3 files changed
Lines changed: 490 additions & 1 deletion
File tree
- .changeset
- packages/metadata-protocol/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments