Skip to content

fix: Prevent stale page writes from recreating moved page directories#8057

Open
afbora wants to merge 1 commit intodevelop-patchfrom
fix/7964-stale-page-write-guard
Open

fix: Prevent stale page writes from recreating moved page directories#8057
afbora wants to merge 1 commit intodevelop-patchfrom
fix/7964-stale-page-write-guard

Conversation

@afbora
Copy link
Copy Markdown
Member

@afbora afbora commented Apr 6, 2026

Description

This fixes a race condition where a stale page instance could still write to an old page path after the page had been moved during reordering.

When that happened, the write path could recreate the missing directory and produce ghost or duplicate page folders.

The fix adds a guard before writing page content. If the original root no longer exists, Kirby resolves the page again from the current app state. If the page was moved in the meantime, the write now fails instead of recreating the old path.

I've implemented the suggestion in my previous comment. I hope you like it:
#7964 (comment)

Changelog

✨ Enhancements

Docs

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@afbora afbora self-assigned this Apr 6, 2026
@afbora afbora requested a review from a team April 6, 2026 14:23
@afbora afbora marked this pull request as ready for review April 6, 2026 14:24
@afbora afbora changed the title fix: Prevent stale page writes from recreating moved page directoriee fix: Prevent stale page writes from recreating moved page directories Apr 6, 2026
@afbora afbora requested a review from lukasbestle April 9, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant