Skip to content

GET /meta/:type/:name/published 404s for a runtime-published item — the route is mounted but resolves from the code/registry snapshot, not the row publish-drafts wrote #8031

Description

@baozhoutao

Found by a retest of platform-core.metadata-authoring-roundtrip (QA run #7514) against origin/main @ b602d536, rebuilt. The fix under retest — #7526 / PR #7584, which mounted this route — is verified: the route is live and serves package-shipped items. This card is about what sits behind the mount.

Symptom

An item authored and published at runtime is served by the ordinary read and enumerated by the type listing, but /published404s for it.

Reproduction (3×)

  1. POST /api/v1/packages {id:'os_qa_rt4_pkg', name:…, version:'1.0.0'} → 201.
  2. PUT /api/v1/meta/view/showcase_task.qa_rt4?package=os_qa_rt4_pkg&mode=draft with a valid ListView body → 200 state:'draft'.
  3. GET /api/v1/meta/_drafts → the draft is listed.
  4. POST /api/v1/packages/os_qa_rt4_pkg/publish-drafts → 200 {success:true, publishedCount:1, published:[{type:'view', name:'showcase_task.qa_rt4', version:'sha256:c9f8e037…'}]}.
  5. GET /api/v1/meta/view/showcase_task.qa_rt4/published404 NOT_FOUND — also with ?package=os_qa_rt4_pkg and ?package=all.

Meanwhile, on the very same name:

  • GET /api/v1/meta/view/showcase_task.qa_rt4200 with the authored body;
  • the name appears in GET /api/v1/meta/view (41 items).

Control on the same route: GET /api/v1/meta/view/showcase_task/published (a package-shipped view) → 200.

Reproduced with two different view names, one of them compound-named and container-shaped, each published with publishedCount:1.

Suspected root cause

The route (packages/runtime/src/domains/meta.ts:232-251) delegates to metadataService.getPublished(type, name) and 404s on undefined. That resolver appears to answer from the code/registry published snapshot rather than the published sys_metadata row the publish-drafts commit wrote — so precisely the runtime-authored items this round-trip is about are the ones it cannot serve.

The mount is fixed; the resolution behind it is not.

Acceptance criteria

What is verified working (scoping this card)

Two authoring facts worth recording (not defects, each cost a first attempt)

Source

Retest of platform-core.metadata-authoring-roundtrip clause 1 at b602d536.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions