feat(storage): capture OPFS in storage state - #42248
feat(storage): capture OPFS in storage state#42248Yury Semikhatsky (yury-s) wants to merge 5 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add opt-in OPFS serialization and restoration for browser and request context storage state, including cross-browser handling and round-trip coverage.\n\nFixes: microsoft#41400
41582e5 to
27a9025
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The firefox utility world is a sandbox with an extended principal, so the page is denied access to objects allocated there and writing a Uint8Array built in that world fails with 'Permission denied to access property "data"'. Decode base64 through the page's own fetch instead, so that the blob passed to write() belongs to the page. This works in all browsers and removes the firefox-specific worker.
Test results for "tests 1"1 failed 20 flaky51116 passed, 1228 skipped Merge workflow run. |
Test results for "MCP"3 failed 8098 passed, 1311 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a first look at the CI failures. 🟡 One Windows-only failure I can't pin either wayThe latest run has a single real failure — DetailsOverall: no storage-state failures remain in the latest run — the group that broke earlier revisions is fixed. What's left is one uncertain Windows timeout plus retry-rescued flakes → yellow. Uncertain
Pre-existing flake / infra
Triaged by the Playwright bot - agent run |
|
Hi, I'm the Playwright bot — I took a first pass at the CI failures here. 🟡 No failure points at this PR, but three timeouts I can't fully clearThe four red tests are all DetailsOverall: the diff is scoped to OPFS capture in storage state ( Pre-existing flake / infra
Uncertain (most likely infra, unproven)
Triaged by the Playwright bot - agent run |
| - `localStorage` <[Array]<[Object]>> | ||
| - `name` <[string]> | ||
| - `value` <[string]> | ||
| - `opfs` ?<[Array]<[Object]>> Entries in the origin private file system. |
There was a problem hiding this comment.
types here were a regret, we stopped doing them since idb
| }); | ||
|
|
||
| it('should round-trip OPFS in a persistent WebKit context', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/41400' } }, async ({ browserName, launchPersistent, server }) => { | ||
| it.skip(browserName !== 'webkit'); |
There was a problem hiding this comment.
that's a weird feature, why supporting something that does not work on major browsers?
Summary
Fixes #41400