Preserve canonical content when a custom-layout move fails
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
Research direction
Start in inc/class-wp-markdown-storage.php at WP_Markdown_Storage::write_profile_post(), especially the custom-layout move sequence around lines 910-924. Trace staging, destination publication, old-path cleanup, path indexing, and changed-path receipts, then add deterministic failure coverage for publication, cleanup, and directory replacement. Done means the acceptance criteria hold without content loss, duplicates, or inconsistent terminal state.
Written by the indexing model from the issue text.
Description
Problem
The custom content-layout move path stages the replacement, deletes the old canonical file, and only then renames the staged file into place. If the final rename fails, the old file has already been removed and the staged file is discarded, leaving no canonical copy.
Relevant implementation: WP_Markdown_Storage::write_profile_post() in inc/class-wp-markdown-storage.php, around lines 910-924.
This violates the canonical durability contract required by the database-independent engine in #232.
Required outcome
- Make custom-layout moves recoverable across the old-path and new-path publication boundary.
- Preserve at least one complete canonical copy when publication or cleanup fails.
- Bind staging and commit to the same verified destination directory identity.
- Keep path indexing and changed-path receipts consistent with the terminal filesystem state.
- Add deterministic failure injection around destination publication and old-path cleanup.
Acceptance criteria
- A failed destination rename leaves the original canonical post intact.
- A successful move leaves exactly one canonical post at the selected route and removes the stale route.
- Retry after an interrupted move converges without content loss or duplicate durable identities.
- Directory replacement between staging and commit fails closed.
AI assistance
GPT-5.6 Sol via OpenCode reviewed the custom-layout publication sequence, identified the delete-before-publish failure mode, and helped structure this issue and its acceptance criteria. Chris Huber directed the review and issue creation.
- Dominant language
- PHP
- Stars
- 7
- Forks
- 1
- Avg merge
- 3h 16m
- Merged PRs (30d)
- 44
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/markdown-database-integration
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Automattic/markdown-database-integration#424 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Automattic/markdown-database-integration#420 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Automattic/markdown-database-integration#415 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Automattic/markdown-database-integration#414 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Automattic/markdown-database-integration#401 ·
Maintainers usually reply within 1 day
All issues in Automattic/markdown-database-integration
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
components-web-app/api-components-bundle#403 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
mollie/PrestaShop#1566 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
components-web-app/docs#193 ·
-
Python 3.15 supportPossibly taken @amnesiaof claimed this today. OpenL: python L: python:uv
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dependabot/dependabot-core#16524 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
crazy-goat/rabbit-stream#830 ·
Maintainers usually reply within 1 day