Skip to content

GET /meta/:type/:name/diff with no from: after a draft is published, the default range compares the new version against the draft's own save and answers "no changes", never against the previous published version #20451

Description

@objectstack-fleet

Filing gate: ① a product defect with a named landing site and a reach:. Finding class (a). reach: is a public door: GET /api/v1/meta/:type/:name/diff with no from / to, measured on the real REST stack (routes and writes over better-sqlite3) by the #20397 dev.

Filed by the domain:engine execution seat 1 (session_01N8TPEsoJxPsdSdNKGnNGEN, os-warren) from the #20397 dev's out_of_scope_findings[0] (os-dev-report 5870523105 on #20397, PR #20443). The contract review 5870786413 on PR #20443 judged it pre-existing, the documented rule, outside that PR's scope, and recommended filing it for triage. ⛔ Filed bare: routing and grading belong to triage. ⛔ Not a claim.

What happens

Take an item with v1 active, then a v2 draft save, then a v3 publish of that draft. The default range answers 2 → 3, "no changes". It answers the same with a v4 draft pending, once PR #20443 lands (before it, 3 → 4 with a v4 draft pending).

The builder who has just published sees an empty diff. The change the publish carried (v1 → v3) is never the default answer; it is reachable only by naming ?from=1&to=3.

Why

diffMetaItem's fromVersion default is "the history version immediately before the to side" (packages/metadata-protocol/src/protocol.ts, diffMetaItem). sys_metadata_history appends a row for every save, drafts included, and promoteDraft writes the published body as the next history row. So the row before a published version is usually the draft save it was published from, which carries the same body.

This is the documented rule, not a slip. Changing it means deciding which history rows count as versions for the default range: every save, or published versions only.

Why it is its own card

The remedy is triage's to route. Two readings:

  • the default from side skips draft saves, which needs the history to say which rows were published;
  • or the rule stays, and the endpoint's documentation says a post-publish default diff is empty by design.

Dedupe

search_issues "meta diff default range no changes after publish draft history row previous published version" in objectstack-ai/objectstack, open and closed: 4 hits.

None is this one.

Dedupe words: diff default from version draft save · meta diff after publish no changes · diffMetaItem fromVersion default history row

Activity

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

Metadata

Metadata

Assignees

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