Skip to content

emdash seed does not create live revisions for published content #650

@r2sake

Description

@r2sake

Description

When using emdash seed to populate content with "status": "published", entries are created without a liveRevisionId. This causes the admin UI to show "Save & Publish" instead of "Unpublish" for already-published content, as the editor checks for the presence of liveRevisionId to determine publication state.

Steps to reproduce

  1. Create a seed.json with published content entries:
{
  "content": {
    "posts": [
      {
        "id": "hello-world",
        "slug": "hello-world",
        "status": "published",
        "data": {
          "title": "Hello World",
          "content": [{ "_type": "block", "style": "normal", "children": [{ "_type": "span", "text": "Hello" }] }]
        }
      }
    ]
  }
}
  1. Run emdash seed seed.json
  2. Open admin at /_emdash/admin and navigate to the seeded entry
  3. Observe the action button shows "Save & Publish" despite status: "published"

Expected behavior

Seeded entries with "status": "published" should have a liveRevisionId created, so the admin UI correctly shows the entry as published with an "Unpublish" option.

Actual behavior

liveRevisionId is null. The admin treats the entry as unpublished. Manually saving each entry from the admin UI creates the revision and fixes the state.

Environment

  • emdash: 0.5.0
  • astro: 5.18.1
  • adapter: @astrojs/node (standalone)
  • database: SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions