Skip to content

[Website] Log OPFS write worker failures - #4125

Merged
adamziel merged 3 commits into
trunkfrom
add-autosave-opfs-error-log
Jul 20, 2026
Merged

[Website] Log OPFS write worker failures#4125
adamziel merged 3 commits into
trunkfrom
add-autosave-opfs-error-log

Conversation

@adamziel

@adamziel adamziel commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

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.onerror wrapper 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.

Copilot AI review requested due to automatic review settings July 20, 2026 18:53

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.

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.

Comment thread packages/playground/website/src/lib/state/opfs/opfs-site-storage.ts
@adamziel
adamziel merged commit 70a61af into trunk Jul 20, 2026
53 checks passed
@adamziel
adamziel deleted the add-autosave-opfs-error-log branch July 20, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment