[Website] Skip incomplete OPFS site directories during startup listing - #4200
Open
adamziel wants to merge 1 commit into
Open
[Website] Skip incomplete OPFS site directories during startup listing#4200adamziel wants to merge 1 commit into
adamziel wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Prevent noisy startup errors by skipping OPFS site-* directories that are missing required metadata (e.g., from an interrupted first save), while preserving existing logging for other read failures.
Changes:
- Skip OPFS entries when listing sites if the read fails with
NotFoundErrororTypeMismatchError. - Add a unit test ensuring incomplete directories are ignored without logging.
- Mock
@php-wasm/loggerin tests to assert no error logs for the skipped case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/playground/website/src/lib/state/opfs/opfs-site-storage.ts | Skips missing/mismatched OPFS entries during startup listing to avoid spurious errors. |
| packages/playground/website/src/lib/state/opfs/opfs-site-storage.spec.ts | Adds coverage for interrupted-save directories and asserts logger is not called. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
An interrupted first save can leave an OPFS
site-*directory behind beforewp-runtime.jsonis written. Startup treated every directory as a stored Playground and logged aNotFoundErrorwhile listing it.Skip missing or mismatched OPFS entries during startup listing. Other read failures still reach the existing error log.
The after capture reloads with
site-funny-sunny-countrystill present withoutwp-runtime.json; the console filter has no matching startup error.Testing
Reload with a metadata-less directory under OPFS
/sitesand confirm startup skips it without a site-read console error.