Skip to content

fix(network): reject body reads after document disposal - #43574

Closed
Devin Rousso (dcrousso) wants to merge 1 commit into
mainfrom
fix-43508
Closed

Devin Rousso (dcrousso) wants to merge 1 commit into
mainfrom
fix-43508

Conversation

@dcrousso

@dcrousso Devin Rousso (dcrousso) commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Chromium can discard a document without reporting request completion, leaving body reads pending

track body availability separately and reject reads when their document is discarded without completing keepalive requests

fixes #43508

`RenderDocument` can discard a document without reporting request completion

track body availability separately and reject pending reads when their document is discarded

leave actual network completion unchanged so keepalive requests can continue

Fixes: <#43508>
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

23556 passed, 701 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/annotate.spec.ts:230 › should capture annotations via show --annotate @mcp-windows-latest-chrome

5188 passed, 614 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failure.

🟢 The failure is a confirmed pre-existing flake

mcp/annotate.spec.ts:230 timed out on Windows Chrome, but the same test and project also failed on unrelated #42978. This PR is clear.

Details

Pre-existing flake

  • [chrome] › mcp/annotate.spec.ts:230 › should capture annotations via show --annotate — the test timed out after 180 seconds while waiting for the Sessions navigation entry. For the exact Windows Chrome test identity, the test-results database has 558 passes and 2 failures across 560 runs; the other failure was on fix(fetch): keep caller's cookie header on same-origin redirects #42978. This PR changes Chromium response-body handling after document disposal and its page-network test, not the MCP dashboard session flow.

Triaged by the Playwright bot - agent run

@dgozman Dmitry Gozman (dgozman) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should figure out why it hangs. I would assume that asking for a response body will reject once the render process is dead. If that does not happen, something seems wrong.

@dcrousso

Copy link
Copy Markdown
Contributor Author

this is related to the RenderDocument feature enabled in #41303

Network.getResponseBody already rejects but internalBody() never reaches it because Chromium sends neither Network.loadingFinished nor Network.loadingFailed after this navigation as it has already destroyed the old document

we could also disable RenderDocument again as that will change how the document is destroyed during the navigation

@dgozman

Copy link
Copy Markdown
Collaborator

I'll look into fixing this in Chromium.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Regression 1.61 → 1.64]: response.text() never settles for a response whose body was cut off by a navigation

2 participants