DEV Community

Scarab Systems
Scarab Systems

Posted on

Scarab Field Test #022 — Playwright Worker Response Header Hang

Target: microsoft/playwright
Issue: microsoft/playwright#39948
Status: local patch prepared and validated
Patch commit: 269228a88 — fix(chromium): resolve worker response header hang

This field test targeted a Playwright Chromium hang where response.allHeaders() could hang for a worker script loaded inside an iframe.

The issue shape is sharp:

a worker script is loaded inside an iframe
the response object exists
response.allHeaders() is called
the promise never settles

That is a serious API boundary failure. A public API that asks for response headers should either return headers or fail. It should not wait forever because the underlying browser/session path did not produce the same metadata events as a normal request.

Failure shape

The failing path involved a worker-main-script response that completed through a worker-frame session.

In that path, Playwright could keep waiting for Chromium extra-info events that never arrived.

The result was a hang.

This is not a generic timeout problem.

It is a response metadata completion problem.

The API has enough response information to complete with provisional raw headers when the worker-frame path does not produce matching extra-info events.

Boundary

The boundary here is:

normal Chromium request response metadata

versus

worker-main-script response metadata in a worker-frame session

For ordinary requests, Playwright should keep using the existing extra-info behavior.

But for this worker-main-script iframe case, waiting forever for extra-info that never arrives violates the API completion contract.

The repair keeps the normal path intact and adds a bounded fallback for the worker-main-script case.

What changed

The patch updates Chromium network response handling in:

packages/playwright-core/src/server/chromium/crNetworkManager.ts

The change allows worker-main-script responses that finish through a worker-frame session to complete header resolution using provisional raw headers when matching Chromium extra-info events are not available.

A focused regression was added in:

tests/page/workers.spec.ts

The regression covers response.allHeaders() for a worker script loaded inside an iframe.

Validation

The focused regression fails without the source fix and passes with it.

Validation passed:

npm run ctest -- tests/page/workers.spec.ts --workers=1 --reporter=line

npm run ctest -- tests/page/page-network-response.spec.ts --workers=1 --reporter=line

npx eslint packages/playwright-core/src/server/chromium/crNetworkManager.ts tests/page/workers.spec.ts

npm run tsc

npm run lint

git diff --check

Field test result

This was a clean local repair against a narrow Chromium response-metadata boundary.

The issue reduced to:

normal requests should keep the existing extra-info path

worker-main-script iframe responses should not hang forever when extra-info does not arrive

response.allHeaders() should settle using the available provisional raw headers in that bounded worker-frame case

focused worker coverage proves the failure and the repair

This is the kind of bug that looks like “Playwright hangs,” but the actual repair is smaller and more precise:

response metadata completion lost ownership in a worker-frame path.

The patch restores deterministic completion without changing normal response waiting semantics.

Public claim

The correct claim for this field test is:

Scarab/SDS helped drive a bounded local repair for microsoft/playwright#39948, where response.allHeaders() could hang on a worker script loaded inside an iframe. The local patch and regression validated successfully, and the repair keeps normal response metadata handling intact while restoring deterministic completion for the worker-frame case.

Disclosure: This field report was prepared with AI-assisted editing from my own field-test notes, patch summary, validation output, and repair record. The technical claims and final wording were reviewed before publication.

Top comments (0)