Skip to content

fix: unblock service-worker registration block after worker-buffer change#3506

Open
kblok wants to merge 1 commit into
masterfrom
fix-sw-block-worker-buffer-interaction
Open

fix: unblock service-worker registration block after worker-buffer change#3506
kblok wants to merge 1 commit into
masterfrom
fix-sw-block-worker-buffer-interaction

Conversation

@kblok

@kblok kblok commented Jun 27, 2026

Copy link
Copy Markdown
Member

A regression from merging #3487 and #3490 together. #3487 made worker CDPSessions buffer their method-events until a consumer flushes them; #3490 blocks a disallowed service worker via Fetch interception on its session. A blocked worker never becomes a CdpWebWorker, so nothing flushed the buffer — the Fetch.requestPaused event stayed buffered, the script fetch stayed paused, and register() hung until the 180s protocol timeout (both ShouldFailServiceWorkerRegistration* tests timed out on master).

Fix flushes the session right after attaching the Fetch listener. Verified locally: both tests pass in ~1s (were hanging).

…tration

Two recently-merged changes interact badly. #3487 made worker CDPSessions
buffer their method-events until a consumer flushes them (so a CdpWebWorker
doesn't miss its init events). #3490 blocks a disallowed service worker by
enabling Fetch interception on its session and failing the paused request.

But a blocked worker never becomes a CdpWebWorker, so nothing ever flushed
its buffer — the Fetch.requestPaused event stayed buffered, the worker's
script fetch stayed paused, and registration hung until the 180s protocol
timeout (the two ShouldFailServiceWorkerRegistration* tests timed out on
every config). Each PR passed alone; together on master they deadlock.

Flush the session right after attaching the Fetch listener so requestPaused
is delivered live. Verified locally: both tests pass in ~1s (were hanging).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant