Skip to content

packages: POST /packages/{id}/revert answers 404 "No metadata items found" for a Studio-authored package that has published items #22090

Description

@objectstack-fleet

Filing gate ① — product defect with a named location and a reproduction. reach: POST /api/v1/packages/com.example.repairs/revert → 404 RESOURCE_NOT_FOUND "No metadata items found for package 'com.example.repairs'" on a Studio package holding 4 published items and 1 draft; the Studio package sheet's Revert button sends exactly this.

Who acts on it: objectstack triage (metadata service owner); objectui follows for the button wording. ⛔ Not a claim. Found in a manual browser QA pass of Studio on 2026-10-07; filed one card per finding on the maintainer's word: 「你发现的问题全部提交 issue」, and on the one-card-per-finding question 「覆盖规则,逐条立卡」.

What happens

In Studio → package switcher → Package info & settings, Revert on a Studio-created writable package fails with the 404 above and leaves the draft in place. Right next to it, Discard changes (1) does discard the draft ("All pending changes discarded — back to the published version."), so the author sees two near-identical verbs, one of which never works on the packages Studio creates.

Reproduction

  1. Studio: create package com.example.repairs, an object, an app, a flow, a permission set; publish; make one more draft edit.
  2. Package sheet → Revert → 404 above. GET /api/v1/meta/_drafts?packageId=com.example.repairs still lists the draft.

Where it comes from (read in source — mechanism inferred, not single-stepped)

revertPackage in packages/metadata/src/metadata-manager.ts collects items from the in-memory registry whose meta.packageId or meta.package equals the id, and throws the 404 when that list is empty. Studio-authored rows live in sys_metadata and are served with a _packageId decoration, so the collection is plausibly always empty for them.

Suggested direction (triage to rule)

Make revertPackage resolve package membership the way the protocol does for sys_metadata rows; if a package has no snapshot to revert to, answer that in words the UI can show. The objectui half (rename or merge Revert with Discard changes, or disable it with a reason) can follow once the server semantics are settled.

Environment

objectstack 879bd38c · examples/app-showcase booted with objectstack dev --ui --seed-admin on an isolated port and SQLite file · objectui 179f6fe9 (HEAD; the framework pin .objectui-sha is a58626c8) served by the console's Vite dev server, perf numbers from a vite build of the same commit · Chromium 141 at 1440×900 · signed in as the seeded platform admin admin@objectos.ai unless stated.

Duplicate check

Dedupe words: package revert 404 · No metadata items found for package · revertPackage _packageId · Revert vs Discard changes

Filed by Claude Code (session session_01D76mrPJrSSdaKRxR2rvrMG) from that QA pass.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:studioChanging a running app without code — authoring, publish, docs and the portalbugSomething isn't workingdomain:enginepriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions