Skip to content

Make draft save and publish atomic - #9

Merged
andycamara merged 1 commit into
mainfrom
fix/atomic-save-publish
Aug 2, 2026
Merged

andycamara merged 1 commit into
mainfrom
fix/atomic-save-publish

Conversation

@andycamara

Copy link
Copy Markdown
Contributor

Summary

  • Require expected-version fencing for mutable saves.
  • Save a page and edited layout draft atomically.
  • Serialize save/publish operations and stop publishing after a failed save.
  • Publish only the exact revision returned by the successful save.
  • Add immutable layout/component dependency pins for published revisions.
  • Keep SQLite and Cloudflare D1 lifecycle behavior aligned.

Root cause

Save, layout persistence, draft recovery, and publish could operate on different mutable revisions, allowing stale writes or publishing a revision other than the one just saved.

Impact

Composer now has an ordered, concurrency-safe save/draft/publish lifecycle with explicit stale-version errors and deterministic publication dependencies.

Migration

Includes aria/migrations/0008_published_dependency_pins.sql. The migration is included in the release but is not applied remotely by this PR.

Validation

  • Every test file touched by the patch was exercised; the isolated timeout caused by concurrent load passed immediately on rerun.
  • The combined v0.5.10 series passed 4,842 tests with 1 skipped, plus check, production build, runtime smoke, and package smoke.

Release plan

Part 5 of 9 for v0.5.10. This end-to-end lifecycle change intentionally remains one PR.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@andycamara, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: aac3c8cf-8efe-4b63-80b2-54c4f1241cfe

📥 Commits

Reviewing files that changed from the base of the PR and between cb05be1 and 8b18e93.

📒 Files selected for processing (97)
  • aria/actions/_shared.ts
  • aria/actions/core.ts
  • aria/actions/pages.ts
  • aria/actions/publishing.ts
  • aria/actions/save.ts
  • aria/actions/styles/globalCssArtifacts.ts
  • aria/admin/App.vue
  • aria/admin/composables/itemLoadingActionResults.ts
  • aria/admin/composables/saveActionResults.ts
  • aria/admin/composables/useActions.ts
  • aria/admin/composables/useComponentFetcher.ts
  • aria/admin/composables/useItemLoading.ts
  • aria/admin/features/Agent/lib/schemas/toolContent.ts
  • aria/admin/features/Agent/lib/tools/content/publishTool.ts
  • aria/admin/features/Blocks/composables/useComponentFetcher.ts
  • aria/admin/features/Blocks/index.ts
  • aria/admin/features/Composer/components/ComponentSettingsPanel.vue
  • aria/admin/features/Composer/components/PageSettingsPanel.vue
  • aria/admin/features/Core/composables/componentCacheCoherence.ts
  • aria/admin/features/Core/composables/useComposerDraftPersistence.ts
  • aria/admin/features/Core/composables/useSavePublish.ts
  • aria/admin/features/Core/utils/draftCache.ts
  • aria/admin/features/Inspector/composables/useClassEditor.ts
  • aria/admin/features/Inspector/composables/useClassEditorHistory.ts
  • aria/admin/features/Inspector/composables/useNavigationProperty.ts
  • aria/admin/features/Inspector/composables/useNodeMutationHistory.ts
  • aria/admin/features/Nodes/composables/useNodeSwap.ts
  • aria/admin/features/Nodes/events/shared/insertNodeViaAction.ts
  • aria/admin/features/Nodes/events/shared/replaceNodeViaAction.ts
  • aria/admin/features/Nodes/events/useNodeComponentHandlers.ts
  • aria/admin/features/Nodes/events/useNodeCrudHandlers.ts
  • aria/admin/features/Stage/components/StageFrame.vue
  • aria/admin/features/Stage/composables/useStageContentSyncActions.ts
  • aria/admin/features/Studio/components/components/ComponentPropertiesPanel.vue
  • aria/admin/features/Studio/components/composables/useComponentResourceBank.ts
  • aria/admin/features/Studio/composer/composables/studioCrudActionResults.ts
  • aria/admin/features/Studio/pages/PageDetailView.vue
  • aria/admin/features/Studio/pages/components/PageCoverImage.vue
  • aria/admin/features/Studio/pages/composables/seoSchemas.ts
  • aria/admin/features/Studio/pages/composables/useDebouncedPageSeoSave.ts
  • aria/admin/features/Studio/pages/composables/usePageAccessState.ts
  • aria/admin/features/Studio/pages/composables/usePageActions.ts
  • aria/admin/features/Studio/pages/composables/usePageDetailState.ts
  • aria/admin/features/Studio/pages/composables/useSeoAnalysis.ts
  • aria/admin/features/Studio/pages/composables/useSeoHistory.ts
  • aria/admin/features/Studio/pages/utils/updatePageLayout.ts
  • aria/admin/features/Studio/realtime/useStudioLive.ts
  • aria/admin/i18n/messages/composer/core.ts
  • aria/lib/publishing/pageDependencies.ts
  • aria/lib/publishing/scheduler/execute.ts
  • aria/lib/publishing/scheduler/reconcile.ts
  • aria/lib/rendering/renderPageDslToHtml.ts
  • aria/lib/schemas/cover.ts
  • aria/lib/schemas/nodes.ts
  • aria/lib/storage/adapter.ts
  • aria/lib/storage/cloudflarePlatform.ts
  • aria/lib/storage/internal/domains/pageLifecycle.ts
  • aria/lib/storage/internal/domains/pageReads.ts
  • aria/lib/storage/sqlitePlatform.ts
  • aria/lib/types/nodes.ts
  • aria/migrations/0008_published_dependency_pins.sql
  • aria/tests/actions/publish-authorship.test.ts
  • aria/tests/actions/publishing-schema.test.ts
  • aria/tests/actions/save-action-nonce.test.ts
  • aria/tests/actions/styles-artifacts.test.ts
  • aria/tests/composables/componentCacheCoherence.test.ts
  • aria/tests/composables/studioCrudActionResults.test.ts
  • aria/tests/composables/useClassEditor.test.ts
  • aria/tests/composables/useClassEditorHistory.test.ts
  • aria/tests/composables/useComponentFetcher.test.ts
  • aria/tests/composables/useComposerDraftPersistence.test.ts
  • aria/tests/composables/useNodeMutationHistory.test.ts
  • aria/tests/composables/usePageAccessState.test.ts
  • aria/tests/composables/useSeoHistory.test.ts
  • aria/tests/core/useItemLoading.test.ts
  • aria/tests/core/useSavePublish.test.ts
  • aria/tests/features/composer/component-settings-panel.test.ts
  • aria/tests/features/composer/page-settings-panel.test.ts
  • aria/tests/features/core/showLayoutSlotGroups.test.ts
  • aria/tests/features/nodes/nodeEventHandlers.extracted.test.ts
  • aria/tests/features/nodes/useNodeSwap.test.ts
  • aria/tests/features/studio/pages/page-cover-image.test.ts
  • aria/tests/features/studio/pages/update-page-layout.test.ts
  • aria/tests/features/studio/pages/usePageDetailState.test.ts
  • aria/tests/features/studio/pages/useSeoAnalysis.component-revision.test.ts
  • aria/tests/features/studio/useComponentResourceBank.test.ts
  • aria/tests/features/studio/useStudioLive.test.ts
  • aria/tests/helpers/d1Mock.ts
  • aria/tests/integration/publishing-snapshot-injection.test.ts
  • aria/tests/lib/rendering/renderPageDslToHtml.test.ts
  • aria/tests/publishing/page-dependencies.test.ts
  • aria/tests/publishing/scheduled-version.test.ts
  • aria/tests/storage/authorship-persistence.test.ts
  • aria/tests/storage/cloudflare-storage.test.ts
  • aria/tests/storage/runStorageMigrations.test.ts
  • aria/tests/storage/sqlite-storage.test.ts
  • src/pages/[...slug].astro

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@andycamara
andycamara marked this pull request as ready for review July 30, 2026 15:34
@andycamara
andycamara force-pushed the fix/atomic-save-publish branch from 58c46b2 to 8b18e93 Compare August 2, 2026 17:47
@andycamara
andycamara merged commit a08affd into main Aug 2, 2026
4 checks passed
@andycamara
andycamara deleted the fix/atomic-save-publish branch August 2, 2026 17:59
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