[Website] Queue Blueprint Run during OPFS synchronization - #4118
Merged
Conversation
adamziel
force-pushed
the
blueprint-run-opfs-sync-barrier
branch
2 times, most recently
from
July 20, 2026 16:06
9d5c809 to
79413a5
Compare
adamziel
marked this pull request as ready for review
July 20, 2026 16:07
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR prevents stored Blueprint “Run” from activating a new Playground while the source Playground is still synchronizing MEMFS → OPFS, by queuing the Run until the live sync finishes (or canceling on sync error).
Changes:
- Queue Blueprint Run when OPFS sync is in progress; lock the editor and show a waiting state until sync completes.
- Resume queued Run when sync clears; cancel queued Run on sync error or site change.
- Add tests covering queued Run behavior, cancellation on sync error, and ignoring stale metadata flags.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.tsx | Adds OPFS-sync-aware Run queuing, editor lockout while queued, and UI messaging updates. |
| packages/playground/website/src/components/blueprint-editor/BlueprintBundleEditor.spec.tsx | Adds unit tests for queued Run during sync, cancellation on sync error, and ensures metadata alone doesn’t block Run. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adamziel
force-pushed
the
blueprint-run-opfs-sync-barrier
branch
from
July 20, 2026 16:30
79413a5 to
0f818aa
Compare
Running a stored Blueprint activates another site and unmounts the source iframe. Doing that while its initial MEMFS-to-OPFS copy is active can leave the source unbootable. Accept Run while the copy is active, lock the editor, and resume after the live sync clears. A reported sync error cancels the request and leaves Run available for explicit recovery. Do not wait on initialOpfsSyncPending; failed boots can leave it set without a live copy.
adamziel
force-pushed
the
blueprint-run-opfs-sync-barrier
branch
from
July 20, 2026 16:55
0f818aa to
8c7566a
Compare
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.
Running a stored Blueprint creates and activates another Playground. If the source Playground is still making its first MEMFS-to-OPFS copy, activation unmounts the iframe that owns that copy before it can be recorded as complete. A later page load can then reject the source as interrupted.
This PR keeps Run available during synchronization without switching sites immediately. Clicking it queues one request, locks the editor, and shows a waiting state. When the live OPFS status clears, the normal Run guards are checked again before the new Playground is created and activated. A reported sync error cancels the request and leaves Run available for an explicit recovery click.
The persisted
initialOpfsSyncPendingflag is deliberately not used as the queue condition. A failed boot can leave it set when there is no active copy to wait for.Testing
Open a stored Playground's Blueprint editor while it is saving. Click Run and confirm the editor waits without switching Playgrounds, then runs after saving completes. If saving fails, confirm the queued Run is cancelled and the button becomes available again.