[Website] Replace failed Blueprint runs before pruning autosaves - #4134
Merged
Conversation
adamziel
marked this pull request as ready for review
July 21, 2026 01:06
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adjusts Blueprint retry behavior so failed/unfinished runs are replaced (and the failed run discarded) before autosave pruning, preventing unrelated Playgrounds from being deleted and updating UI messaging accordingly.
Changes:
- On retry, activates the replacement site and attempts to remove the failed run before pruning autosaves (and aborts pruning if removal fails).
- Updates the Blueprint editor hint text logic to avoid implying failed runs will remain in Recent after retry.
- Extends unit tests to cover removal-before-prune ordering and the “do not prune if removal fails” case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.tsx | Reorders retry flow to remove failed runs before pruning; adjusts run-hint rendering for unfinished runs. |
| packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.spec.tsx | Adds tests ensuring removal happens before pruning and pruning is skipped if removal fails. |
Comments suppressed due to low confidence (1)
packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.tsx:1
- If
removeSite/pruneAutosavedSitesare async thunks (e.g., created with RTKcreateAsyncThunk),dispatch(thunk)typically resolves to an action and does not throw on rejection unless unwrapped. In that case, thecatchblock won’t run and pruning may still proceed even when removal failed—contradicting the intended safety behavior. Consider unwrapping the dispatched promise (or explicitly checking for a rejected action) so failures reliably abort pruning.
import { autocompletion } from '@codemirror/autocomplete';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Retrying an unfinished Blueprint run creates a replacement but used to leave the failed candidate behind. Activate the replacement, discard the failed run, and only then enforce autosave retention. If that discard fails, skip pruning rather than deleting an unrelated Playground to compensate. Keep the original return target and hide the stale hint that said the failed run would remain in Recent. Autosave pruning already handles its own deletion failures, so remove the editor-level catch and the test that modeled a rejected prune.
adamziel
force-pushed
the
replace-failed-blueprint-runs-safely
branch
from
July 21, 2026 01:20
924cd81 to
b484990
Compare
adamziel
added a commit
that referenced
this pull request
Jul 21, 2026
Builds on #4134. A stored Blueprint can fail before its first WordPress file copy completes. The old error dialog could be dismissed, leaving a loading screen that could never finish. This PR makes the error dialog the recovery screen. It keeps the specific failure reason and offers two explicit actions: - **Edit Blueprint** opens the Blueprint editor so the input can be corrected. - **Return to your last Playground** discards the failed run and restores the Playground that launched it. If that Playground no longer exists, the second action starts a new one instead. Seamless mode omits the editor and makes the return action primary. The dialog cannot be closed with an X, Escape, or an outside click. Close does not secretly navigate. Private repository authentication may cover it temporarily; the recovery dialog returns when authentication closes. Reloading an interrupted run also stops before booting WordPress again. It keeps the return target and does not delete the partial files behind the user's back. | Desktop before | Desktop after | | --- | --- | | <img width="720" alt="Before: an unavailable release dialog with no route back to the Blueprint" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/39e991af1c1df706f2008630cfa69032a33aefd6/after-desktop.png"> | <img width="720" alt="After: an unavailable release dialog with AI troubleshooting and explicit Blueprint recovery actions" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/8964cf1261bd2761eb0ff7318b04ad35c1789487/after-desktop.png"> | | Mobile before | Mobile after | | --- | --- | | <img width="390" alt="Before on mobile: an unavailable release dialog with no route back to the Blueprint" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/39e991af1c1df706f2008630cfa69032a33aefd6/after-mobile.png"> | <img width="390" alt="After on mobile: an unavailable release dialog with AI troubleshooting and explicit recovery actions" src="https://raw.githubusercontent.com/WordPress/wordpress-playground/8964cf1261bd2761eb0ff7318b04ad35c1789487/after-mobile.png"> | ## Testing 1. From a stored Playground, run a Blueprint with `preferredVersions.wp` set to `999.9`. 2. Confirm the failure dialog shows the unavailable version, keeps **Troubleshoot with AI**, and cannot be dismissed. 3. Open **Edit Blueprint**, close the editor, and confirm the failure dialog returns. 4. Choose **Return to your last Playground** and confirm the original Playground opens and the failed run is absent from Recent. 5. Repeat at a mobile viewport.
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.
Part of #4099.
Builds on #4129.
Retrying an unfinished Blueprint run now replaces the failed Playground before autosave pruning begins.
The retry keeps the original Playground as its return target, creates and activates the replacement, and then removes the failed run. Only after that succeeds does it prune old autosaves. If the failed run cannot be removed, pruning stops instead of deleting an unrelated Playground to make room.
Autosave pruning already handles its own deletion failures, so the Blueprint editor no longer wraps it in a second
try/catch. The editor also stops claiming that the failed run will remain in Recent after retry.Testing
From a stored Playground, run a Blueprint with
preferredVersions.wpset to999.9. Open the failed run in the Blueprint editor, change the version tolatest, and run it again. Confirm the replacement opens, the original Playground remains, and the failed run is absent from Recent.