Repository navigation
feat(network): add request.body async getters for blob request bodies - #41888
Yury Semikhatsky (yury-s) wants to merge 1 commit 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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hi, I'm the Playwright bot and I took a look at the CI failures here. 🟢 Both failures are pre-existing flakes — this PR is clearThe two failing tests both flake on their own across unrelated runs, and never on this PR's SHA ( DetailsOverall: the newest "tests 1" report is 1 failed / 50240 passed; the concurrent MCP report is 1 failed / 7759 passed. No CI signal attributable to this PR. Pre-existing flake / infra
I'm a first pass, not the final word — but the diff is confined to Blob/File post-data reporting plus Triaged by the Playwright bot - agent run |
Chromium and WebKit only report hasPostData for blob-backed request bodies on Network.requestWillBeSent. Fetch such bodies asynchronously via Network.getRequestPostData and deliver them through the request.body()/bodyBuffer()/bodyJSON() getters restored from microsoft#38179. WebKit support requires build 2337. Fixes: microsoft#6479
61b4c36 to
119aac6
Compare
Test results for "MCP"1 failed 7785 passed, 1249 skipped Merge workflow run. |
Test results for "tests 1"2 flaky50115 passed, 1192 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a look at the CI failures here. 🟡 One failure I can't tie to this PR — but can't yet call a flake either
DetailsOverall: the newest merged report ("MCP") is 1 failed / 7785 passed. The diff is confined to Blob/File POST-data reporting — Uncertain
Triaged by the Playwright bot - agent run |
collectEvents patched navigator.sendBeacon in WebKit on the side, and read the browser from the page's context, which is null for a persistent context and would skip the patch without a word. The web vitals test now calls readBeaconBodiesInWebKit itself with the browserName fixture, and the other analytics tests don't need it: their events go by fetch. The workaround's own test only checked postDataBuffer(), so a Playwright fix that adds async body getters, as microsoft/playwright#38718 and microsoft/playwright#41888 proposed, would have left it green. It now reads a Blob beacon through postData(), postDataBuffer(), postDataJSON() and any body getter a later version adds, and sends the same beacon through the workaround to show that one arrives with its body. The patched sendBeacon also falls back to the Blob when reading it fails, and says it returns true before it sends. ADR 0013 records why the test doesn't wait for PostHog's five-second batch instead: that batch has no INP or CLS.
collectEvents patched navigator.sendBeacon in WebKit on the side, and read the browser from the page's context, which is null for a persistent context and would skip the patch without a word. The web vitals test now calls readBeaconBodiesInWebKit itself with the browserName fixture, and the other analytics tests don't need it: their events go by fetch. The workaround's own test only checked postDataBuffer(), so a Playwright fix that adds async body getters, as microsoft/playwright#38718 and microsoft/playwright#41888 proposed, would have left it green. It now reads a Blob beacon through postData(), postDataBuffer(), postDataJSON() and any body getter a later version adds, and sends the same beacon through the workaround to show that one arrives with its body. The patched sendBeacon also falls back to the Blob when reading it fails, and says it returns true before it sends. ADR 0013 records why the test doesn't wait for PostHog's five-second batch instead: that batch has no INP or CLS.
collectEvents patched navigator.sendBeacon in WebKit on the side, and read the browser from the page's context, which is null for a persistent context and would skip the patch without a word. The web vitals test now calls readBeaconBodiesInWebKit itself with the browserName fixture, and the other analytics tests don't need it: their events go by fetch. The workaround's own test only checked postDataBuffer(), so a Playwright fix that adds async body getters, as microsoft/playwright#38718 and microsoft/playwright#41888 proposed, would have left it green. It now reads a Blob beacon through postData(), postDataBuffer(), postDataJSON() and any body getter a later version adds, and sends the same beacon through the workaround to show that one arrives with its body. The patched sendBeacon also falls back to the Blob when reading it fails, and says it returns true before it sends. ADR 0013 records why the test doesn't wait for PostHog's five-second batch instead: that batch has no INP or CLS.
Summary
hasPostDatafor blob-backed request bodies onNetwork.requestWillBeSent; fetch such bodies asynchronously viaNetwork.getRequestPostDatarequest.body()/bodyBuffer()/bodyJSON()async getters from feat: add request.body async getters #38179 and deliver the asynchronously fetched bodies through them;postData*are marked discouragedFixes #6479