[Website] Log OPFS write worker failures - #4125
Merged
Merged
Conversation
adamziel
requested review from
a team,
bgrgicak and
Copilot
and removed request for
Copilot
July 20, 2026 18:30
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improve diagnostics for OPFS autosave failures by surfacing the original worker-side exception details to the Playground logger.
Changes:
- Send structured error details (path + serialized error) from the Safari OPFS write worker to the main thread.
- Handle typed worker error messages in
opfsWriteFile()by logging and rejecting with a clearer message.
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 | Adds handling/logging for typed error messages coming back from the OPFS write worker. |
| packages/playground/website/src/lib/state/opfs/opfs-site-storage-worker-for-safari.ts | Wraps worker write logic in try/catch and posts structured error payloads back to the caller. |
💡 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.
Logs the original exception thrown inside the OPFS metadata write worker.
Before this PR, a failed browser-storage autosave could surface only as the parent
worker.onerrorwrapper while writing/sites/.../wp-runtime.json. That message names the file but loses the OPFS call that actually failed inside the worker.This PR catches worker exceptions, logs the target OPFS path and original error object to the Playground logger, then rethrows. The current autosave failure flow stays unchanged; the next Chrome DevTools report should contain the missing cause.
Testing
Trigger an OPFS write worker failure and confirm DevTools includes
Error in OPFS write worker.with the target path and original error.