[Website] Preserve concurrent metadata while preparing Blueprint drafts - #4116
Merged
Conversation
adamziel
force-pushed
the
copied-blueprint-bundle-ownership
branch
from
July 20, 2026 14:20
6a53b15 to
358ab61
Compare
adamziel
force-pushed
the
blueprint-draft-metadata-update
branch
from
July 20, 2026 14:41
45c20c4 to
2e9a637
Compare
adamziel
marked this pull request as ready for review
July 20, 2026 14:42
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes a race where opening the Blueprint editor during an autosave OPFS copy could restore stale site metadata (e.g., re-setting initialOpfsSyncPending) by only writing the Blueprint-related metadata after the bundle is persisted.
Changes:
- Swap from writing a full metadata snapshot to updating only
originalBlueprint/originalBlueprintSourceafter persisting the bundle. - Simplify OPFS blueprint bundle loading by using the persisted backend directly.
- Add a component-level test to ensure only Blueprint metadata is updated after persistence completes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/playground/website/src/components/blueprint-editor/SiteBlueprintBundleEditor.tsx | Avoids stale metadata writes by dispatching a targeted metadata update after bundle persistence. |
| packages/playground/website/src/components/blueprint-editor/SiteBlueprintBundleEditor.spec.ts | Adds coverage for the race condition by asserting metadata updates happen only after persistence resolves. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Autosaved sites migrate declaration-only Blueprints to an OPFS draft in an async effect. The effect spread the SiteInfo snapshot it started with back into Redux after I/O. A boot or sync that updated metadata in the meantime could have its changes reverted. Use the backend returned by persistBlueprintBundle and update only originalBlueprint and originalBlueprintSource. Lifecycle metadata is left alone.
adamziel
force-pushed
the
blueprint-draft-metadata-update
branch
from
July 20, 2026 14:44
2e9a637 to
0cf2d08
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.
Opening the Blueprint editor while an autosaved Playground is still copying its WordPress files into OPFS could put the Playground back into a pending state.
The editor stored its Blueprint bundle asynchronously, then wrote the entire site metadata snapshot captured before that work started. If boot cleared
initialOpfsSyncPendingin the meantime, this stale write restored it.Update only
originalBlueprintandoriginalBlueprintSourceafter storing the bundle. Boot and synchronization metadata is left alone.Testing
Open the Blueprint editor for a newly created autosaved Playground while its initial save completes. Reload and confirm it opens from its stored files.