Skip to content

fix(revisions): preserve manual Save checkpoints after autosave - #3834

Closed
khoinguyenpham04 wants to merge 2 commits into
noah/content-write-casfrom
noah/content-save-history
Closed

khoinguyenpham04 wants to merge 2 commits into
noah/content-write-casfrom
noah/content-save-history

Conversation

@khoinguyenpham04

Copy link
Copy Markdown
Collaborator

What does this PR do?

Keeps manual Save checkpoints in revision history when the next autosave runs. Autosave replaces only a superseded autosave; live revisions remain protected and the existing bounded history-pruning policy is unchanged.

Migration 092 adds a default-zero autosave marker. Existing revisions stay manual checkpoints, and concurrent or retried upgrades converge without modifying their content. Only skipRevision saves set the marker; abandoned CAS writes still use the general cleanup path.

Depends on #3832. Rolling-deployment prerequisite: release and deploy that compatibility patch to every application instance before applying this migration. The lower PR predeclares the excluded bookkeeping column so those instances can still export after schema expansion. Imported revisions conservatively default to manual; the transfer package format is unchanged.

Stack layer 2/5. Visual-editor safety, publication validation, and live-metadata disclosure remain separate layers.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added and reviewed the user-facing changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...
  • I have included screenshots below if this PR changes the UI

Translation/screenshots are not applicable: no UI markup or strings change. Discussion is not applicable: this fixes a reproduced bug.

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Codex, GPT-6.1 Sol (max); persistent second-opinion review by GPT-5.6 (xhigh).

Screenshots / test output

Screenshots: Not applicable.

  • Regression first: 4 SQLite/PostgreSQL failures reproduce deleted manual checkpoints on draft and published entries; the live-revision protection cases already pass on the parent.
  • Current core/history/CAS/migration/transfer suites: 205 passed across 12 files, including real PostgreSQL parity.
  • Real D1 migration/history/CAS suites: 6 passed.
  • Upgrade fixtures preserve 50 large legacy snapshots and exercise concurrent application, completed-statement retries, and subsequent autosaves on SQLite, PostgreSQL, and D1.
  • A concurrent-upgrade regression independently fails before the duplicate-column recovery fix on both SQLite and PostgreSQL.
  • Root pnpm build, pnpm typecheck, pnpm lint, pnpm lint:quick, and pnpm format pass; type-aware JSON lint has zero diagnostics.
  • Persistent GPT-5.6/xhigh review: migration-race major fixed, rolling-deployment compatibility prerequisite moved to the parent, and the latest layer-2 pass (3) is clean. No findings remain.

@changeset-bot

changeset-bot Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 945fe77

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/plugin-test Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/admin Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
create-emdash Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://noah-content-save-history.try.emdashcms.com, https://noah-content-save-history-emdash-playground.emdash-cms.workers.dev (commit 945fe77)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://da02893a.try.emdashcms.com, https://da02893a-emdash-playground.emdash-cms.workers.dev 945fe77 2026-10-04T20:08:25.235Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ebf5a609.try.emdashcms.com, https://ebf5a609-emdash-playground.emdash-cms.workers.dev 2ddfddc 2026-10-03T21:18:32.545Z Visit the dashboard ↗

@pkg-pr-new

pkg-pr-new Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@3834

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@3834

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@3834

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@3834

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@3834

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@3834

emdash

npm i https://pkg.pr.new/emdash@3834

create-emdash

npm i https://pkg.pr.new/create-emdash@3834

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@3834

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@3834

@emdash-cms/plugin-test

npm i https://pkg.pr.new/@emdash-cms/plugin-test@3834

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@3834

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@3834

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@3834

@emdash-cms/registry-loader

npm i https://pkg.pr.new/@emdash-cms/registry-loader@3834

@emdash-cms/registry-moderation

npm i https://pkg.pr.new/@emdash-cms/registry-moderation@3834

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@3834

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@3834

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@3834

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@3834

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@3834

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@3834

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@3834

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@3834

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@3834

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@3834

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@3834

commit: 945fe77

@khoinguyenpham04 khoinguyenpham04 added the bot:review Trigger an emdashbot code review on this PR label Oct 4, 2026
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Oct 4, 2026
@khoinguyenpham04
khoinguyenpham04 force-pushed the noah/content-save-history branch from 2ddfddc to 945fe77 Compare October 4, 2026 20:03
@khoinguyenpham04 khoinguyenpham04 mentioned this pull request Oct 4, 2026
8 of 19 tasks
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 945fe77 Oct 04 2026, 08:06 PM

@khoinguyenpham04
khoinguyenpham04 removed this pull request from stack #3844 October 4, 2026 20:12
@khoinguyenpham04
khoinguyenpham04 added this pull request to stack #3866 October 4, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant