Skip to content

fix: only push and pull models with meaningful changes#217

Draft
angeloashmore wants to merge 1 commit into
mainfrom
aa/canonicalize-models-on-write
Draft

fix: only push and pull models with meaningful changes#217
angeloashmore wants to merge 1 commit into
mainfrom
aa/canonicalize-models-on-write

Conversation

@angeloashmore

@angeloashmore angeloashmore commented Jul 7, 2026

Copy link
Copy Markdown
Member

Resolves:

Description

The Prismic API sometimes returns model properties in a different order than the local files. That is not a real change, but pull, push, and status treated it as one. Users saw models to sync when nothing had really changed.

These commands now act only on real changes, like a new field, a reordered field, or a changed value. A difference in property order alone is ignored.

These two are treated as the same model. Only the property order changed:

{
  "id": "page",
  "label": "Page",
  "repeatable": true,
  "json": { "Main": { "title": { "type": "Text" } } }
}
{
  "label": "Page",
  "repeatable": true,
  "json": { "Main": { "title": { "type": "Text" } } },
  "id": "page"
}

Reordering fields is a real change, so it still syncs:

{
  "id": "page",
  "label": "Page",
  "repeatable": true,
  "json": {
    "Main": {
      "title": { "type": "Text" },
      "body": { "type": "Text" }
    }
  }
}
{
  "id": "page",
  "label": "Page",
  "repeatable": true,
  "json": {
    "Main": {
      "body": { "type": "Text" },
      "title": { "type": "Text" }
    }
  }
}

Local files also stay stable. A pull writes properties in a consistent order, so later pulls only show real edits.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA

prismic pull
# In a custom type's index.json, reorder some metadata keys by hand.
# Keep the values and the field order the same.
prismic status
# Expect: "Already up to date."

@angeloashmore angeloashmore force-pushed the aa/canonicalize-models-on-write branch from 6760dbc to 03882ca Compare July 7, 2026 21:19
@angeloashmore angeloashmore changed the title fix: canonicalize models on read and write fix: only push and pull models with meaningful changes Jul 7, 2026
The Prismic API sometimes returns model properties in a different order
than the local files. That is not a real change, but pull, push, and
status treated it as one, so users saw models to sync when nothing had
really changed.

These commands now act only on real changes, like a new field, a
reordered field, or a changed value. A difference in property order
alone is ignored. Local files also stay stable, so later pulls only show
real edits.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore force-pushed the aa/canonicalize-models-on-write branch from 03882ca to ffceb86 Compare July 7, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant