Repository navigation
Conversation
On WordPress 7.1 the block editor is sent with Document-Isolation-Policy in Chromium, so the shell cannot call the editor frame's location.reload(). The title-bar Reload then fell back to re-assigning the iframe's src. A window opened on post-new.php keeps that src after the first save, even though the editor has moved itself to post.php?post=N, so Reload opened a brand-new empty draft and the post with its photos looked gone. The fallback now loads the URL the page last reported, which is what the reload already uses everywhere else.
…ost-often-fails-or-is-slow
Collaborator
Author
|
@claude please review this |
|
Claude finished @epeicher's task in 23s —— View job Review of #1010: Reload a saved new post, not an empty draftVerdict: looks good. I found no blocking issues.
What I checked
Non-blocking notes
I didn't run the build, lint or test commands. The PR description says they pass, and CI will check them. |
Collaborator
Author
|
Thanks for the review. I'm leaving the three non-blocking notes as they are:
|
epeicher
deleted the
opensta-265-editor-adding-photos-inside-a-post-often-fails-or-is-slow
branch
October 14, 2026 14:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The title-bar Reload on a post window that was opened as a new post now reloads the saved post. Before, it opened a brand-new empty draft, so the post and the photos just added to it looked gone.
Why
On WordPress 7.1 the block editor turns on client-side media processing. In Chromium 137+ (on HTTPS or localhost) it sends
Document-Isolation-Policy: isolate-and-credentiallessonpost.php/post-new.php. The editor frame then lives in its own agent cluster: the shell can stillpostMessageit, butcontentWindow.location.reload()throws.Window.reload()caught that and fell back toiframe.src = iframe.src. After a first save, Gutenberg moves its own URL frompost-new.phptopost.php?post=NwithreplaceState, andsrcnever changes. So the fallback loadedpost-new.phpagain.The fallback now loads
getCurrentUrl(), the URL the page last reported, whichreload()already computes for its other paths.Investigation notes
This came out of looking into reports that adding photos to a post in a window fails or is slow. Every upload path worked and was as fast as classic wp-admin, in a window and outside one:
Every image got all its sub-sizes, and every request returned 2xx. The older "often doesn't work" report predates #962, which stopped the bridge's request tracking from holding on to upload bodies. The Reload bug was the one real defect found.
Testing
post-new.php).post.php?post=Nwith the image, not an empty new draft.tests/vitest/window-unsaved-navigation.test.tscovers the fallback and fails without the fix.npm run build,npm run lint,npm run typecheckandnpm run test:jspass.