Skip to content

Commit 60ed94f

Browse files
committed
chore(changeset): patch for @objectstack/metadata revertPackage membership
Claude-Session: https://claude.ai/code/session_01EUBvqtauTDmHi2ZgY759p2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent cffca05 commit 60ed94f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/metadata': patch
3+
---
4+
5+
fix(metadata): reverting a code-shipped package no longer answers 404 "No metadata items found" for items every read serves
6+
7+
Clause-②: no
8+
9+
`MetadataManager.revertPackage` collected a package's members by an item's own `packageId` or `package` key. A code-shipped item carries only the private `_packageId` stamp: the artifact loader writes it through `applyProtection`, and the ObjectQL object bridge copies it onto every object it registers in the metadata service. So `POST /api/v1/packages/:id/revert` answered `404 RESOURCE_NOT_FOUND` "No metadata items found for package '…'" for a code-shipped package, for example `com.objectstack.platform-objects`, while every read served that package's items.
10+
11+
`revertPackage` now also counts an item stamped with `_packageId` as a member. A code-shipped package that nothing was ever published for now gets the declared `409 RESOURCE_CONFLICT` "Package '…' has never been published". A package that was published is restored exactly as before, and an id that nothing carries still answers `404`.
12+
13+
`publishPackage` still finds members by `packageId` and `package` only. If it also read the stamp, nothing in it would refuse a read-only code package: the package's objects would be snapshotted and re-registered as published, which ADR-0070 D2 rules out. So a code package's stamped items are still not published by it.
14+
15+
A package whose items the metadata service never holds still answers `404`. This covers a package that ships only apps, navigation or docs, such as `com.objectstack.setup`.

0 commit comments

Comments
 (0)