Skip to content

Commit 4389fe9

Browse files
Jack Qclaude
andauthored
fix(rest): the 501 on /meta/:type/:name/published now states its true post-#8278 condition (#10160)
Both `/published` arities share one message literal (a `for` loop registers the same handler for both routes), reached only after the runtime-published overlay consult finds nothing. Post-#8278 that 501 no longer means "this kernel cannot answer /published" -- it means "nothing is runtime-published for this item, and this kernel has no code/package store" -- so reword it to say that instead of the stale "metadata.getPublished() is not available in this kernel". Per the maintainer ruling on #8297 (2026-08-20, minimal action): getPublished stays optional on IMetadataService (no contract movement), and the documented existing-but-never-published -> 200 fallback semantics are untouched. Status code, error.code, and routing order are byte-identical -- only the message prose changed. meta-published-overlay.test.ts SS8 (which pins the exact response body) is updated to match; SS9 (the 200-from-overlay arm) is untouched. Claude-Session: https://claude.ai/code/session_016gcKVsiywU9CcS96S5t9qD Co-authored-by: Claude <noreply@anthropic.com>
1 parent 19f98fa commit 4389fe9

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@objectstack/rest": patch
3+
---
4+
5+
Reworded the `501 NOT_IMPLEMENTED` message on `GET /meta/:type/:name/published` (and its
6+
compound-name arity) to state its true post-#8278 condition. Since #8278 put the
7+
runtime-published overlay consult ahead of this arm, the 501 no longer means "this kernel
8+
cannot answer `/published`" — it means "nothing is runtime-published for this item, and
9+
this kernel has no code/package store" (i.e. `metadata.getPublished()` is unavailable).
10+
The old message ("metadata.getPublished() is not available in this kernel") overstated
11+
that condition. Status code, `error.code`, and routing order are unchanged — only the
12+
message text changed.

packages/rest/src/meta-published-overlay.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,10 @@ describe('[#8278] what the overlay consult must NOT change', () => {
425425
expect(res.body).toEqual({
426426
error: {
427427
code: 'NOT_IMPLEMENTED',
428-
message: 'metadata.getPublished() is not available in this kernel',
428+
// [#8297] Reworded to state the TRUE post-#8278 condition — this
429+
// arm is reached only after a null overlay consult, so it no
430+
// longer means "this kernel cannot answer /published" at all.
431+
message: 'Nothing is runtime-published for this item, and this kernel has no code/package store (metadata.getPublished() is not available).',
429432
},
430433
});
431434
}, 60_000);

packages/rest/src/rest-server.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6253,10 +6253,20 @@ export class RestServer {
62536253

62546254
const svc = await this.resolveMetadataService(environmentId, req);
62556255
if (typeof (svc as any)?.getPublished !== 'function') {
6256+
// [#8297] Reached ONLY when the overlay consult above
6257+
// found nothing (a null `layered.overlay`) — so this is
6258+
// no longer "this kernel cannot answer /published" (the
6259+
// pre-#8278 reading); it is the narrower, rarer
6260+
// condition the message below actually states: nothing
6261+
// is runtime-published for this item, AND this kernel's
6262+
// metadata slot has no code/package store to fall back
6263+
// to (`getPublished` is optional on `IMetadataService`
6264+
// and unimplemented here). Status, `code`, and routing
6265+
// order are unchanged — only the prose was stale.
62566266
res.status(501).json({
62576267
error: {
62586268
code: 'NOT_IMPLEMENTED',
6259-
message: 'metadata.getPublished() is not available in this kernel',
6269+
message: 'Nothing is runtime-published for this item, and this kernel has no code/package store (metadata.getPublished() is not available).',
62606270
},
62616271
});
62626272
return;

0 commit comments

Comments
 (0)