Skip to content

Commit b27dcd2

Browse files
os-zhuangclaude
andcommitted
chore(changeset): metadata-protocol patch for publish-drafts org-scope fix (#3115)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 1d04279 commit b27dcd2

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@objectstack/metadata-protocol": patch
3+
---
4+
5+
Publish/discard package drafts in the draft's own org scope, fixing `no_draft` after saving a draft via Studio.
6+
7+
Studio "Save Draft" (`PUT /meta/:type/:name?mode=draft`) never threads the session's `activeOrganizationId`, so the draft row is written env-wide (`organization_id = NULL`). "Publish" (`POST /packages/:id/publish-drafts`) resolves the active org and passed it to `promoteDraft`, which looked the draft up with a strict `organization_id = <org>` equality — so it 404'd (`[no_draft] No pending draft exists …`) on the env-wide row it could never match, even though `listDrafts` had already surfaced that draft to the publish CTA (PR #1852's `$or`). `discardPackageDrafts` had the same latent gap.
8+
9+
`listDrafts` now projects each draft's own `organizationId`, and `publishPackageDrafts` / `discardPackageDrafts` promote / delete each draft in that scope (env-wide stays env-wide, per-org stays per-org). Seed-body capture and the ADR-0067 revert-plan pre-state read are scoped the same way.
10+
11+
Fixes #3115.

0 commit comments

Comments
 (0)