Skip to content

[Website] Skip incomplete OPFS site directories during startup listing - #4200

Open
adamziel wants to merge 1 commit into
trunkfrom
adamziel/skip-incomplete-opfs-site-listings
Open

[Website] Skip incomplete OPFS site directories during startup listing#4200
adamziel wants to merge 1 commit into
trunkfrom
adamziel/skip-incomplete-opfs-site-listings

Conversation

@adamziel

@adamziel adamziel commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

An interrupted first save can leave an OPFS site-* directory behind before wp-runtime.json is written. Startup treated every directory as a stored Playground and logged a NotFoundError while listing it.

Skip missing or mismatched OPFS entries during startup listing. Other read failures still reach the existing error log.

Before After
Before: an incomplete OPFS directory logs a NotFoundError on reload After: the console filtered for Error reading site has no matching message

The after capture reloads with site-funny-sunny-country still present without wp-runtime.json; the console filter has no matching startup error.

Testing

Reload with a metadata-less directory under OPFS /sites and confirm startup skips it without a site-read console error.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NotFoundError or TypeMismatchError.
  • Add a unit test ensuring incomplete directories are ignored without logging.
  • Mock @php-wasm/logger in 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants