Part of the proxy-disabled / HTTP/2 pipeline work. Follow-up to #34555 / #34566, raised by Cursor Bugbot in review. Low priority — see Impact.
What & why
With CYPRESS_INTERNAL_DISABLE_PROXY=1, responses fetched on a service worker's CDP session run the middleware onion but arrive with no Set-Cookie, so cookie simulation never applies. Set-Cookie only travels on Network.responseReceivedExtraInfo (#34327), never on a Fetch pause, and CDPNetworkExtraInfo correlates those by ${sessionId}:${requestId} on the page connection — where Network is deliberately not enabled for service_worker targets. So no entry ever exists for a SW-session pause. MITM parity drift: the proxy does see service worker wire fetches.
Impact — why this is low priority
With the proxy disabled there is no server-side cookie jar; the browser is the source of truth. The only consumer of Set-Cookie on that path is simulated-top rewriting — applying cookies as though the AUT were top-level rather than iframed — and a service worker has no document and no top-level browsing context, so that has little meaning for its fetches.
The one case that could matter is a worker handling a document navigation, since that response becomes the AUT document in a frame; instrumenting the driver spec showed 14 such navigations among the 58 SW-session pauses. Nothing regresses by deferring — before #34555, service worker traffic ran no middleware at all.
Do not re-try: awaiting Network.enable deadlocks
CriClient._onAttachedToTarget awaits the onServiceWorkerTargetAttached hook before Runtime.runIfWaitingForDebugger, and CDP does not answer Network.enable on a target still paused for the debugger — so the worker is never released. service-worker.cy.js drops 28/28 → 0 passing on Chrome and Electron, and service_worker_spec.js regresses too. It is the await, not the ordering: Fetch.enable is answered while paused, which is the only reason the current code works. Un-awaited works but lands after the worker starts, so the earliest pauses still miss extraInfo.
Options
- Preferred: send
Network.enable un-awaited, keep the promise, and have the transport await it before extraInfo lookups on that session. Fetch interception is installed before the worker is released, so nothing escapes while we wait — this blocks a request briefly rather than the debugger.
- Have
CDPNetworkExtraInfo observe the browser connection, where Network is already enabled for SW targets, joining via targetInfo.targetId. Risk: CDP request ids are per-session, so the same request may not share an id across connections.
- Accept the drift and record it in the proxy-disabled behavior-changes log.
Acceptance criteria
Nothing detects this today, so the fixture is really the deliverable that decides whether 1–2 are worth building.
system-tests-electron-cdp-remediated carries no service-worker specs — worth closing while here.
Part of the proxy-disabled / HTTP/2 pipeline work. Follow-up to #34555 / #34566, raised by Cursor Bugbot in review. Low priority — see Impact.
What & why
With
CYPRESS_INTERNAL_DISABLE_PROXY=1, responses fetched on a service worker's CDP session run the middleware onion but arrive with noSet-Cookie, so cookie simulation never applies.Set-Cookieonly travels onNetwork.responseReceivedExtraInfo(#34327), never on aFetchpause, andCDPNetworkExtraInfocorrelates those by${sessionId}:${requestId}on the page connection — whereNetworkis deliberately not enabled forservice_workertargets. So no entry ever exists for a SW-session pause. MITM parity drift: the proxy does see service worker wire fetches.Impact — why this is low priority
With the proxy disabled there is no server-side cookie jar; the browser is the source of truth. The only consumer of
Set-Cookieon that path is simulated-top rewriting — applying cookies as though the AUT were top-level rather than iframed — and a service worker has no document and no top-level browsing context, so that has little meaning for its fetches.The one case that could matter is a worker handling a document navigation, since that response becomes the AUT document in a frame; instrumenting the driver spec showed 14 such navigations among the 58 SW-session pauses. Nothing regresses by deferring — before #34555, service worker traffic ran no middleware at all.
Do not re-try: awaiting
Network.enabledeadlocksCriClient._onAttachedToTargetawaits theonServiceWorkerTargetAttachedhook beforeRuntime.runIfWaitingForDebugger, and CDP does not answerNetwork.enableon a target still paused for the debugger — so the worker is never released.service-worker.cy.jsdrops 28/28 → 0 passing on Chrome and Electron, andservice_worker_spec.jsregresses too. It is the await, not the ordering:Fetch.enableis answered while paused, which is the only reason the current code works. Un-awaited works but lands after the worker starts, so the earliest pauses still miss extraInfo.Options
Network.enableun-awaited, keep the promise, and have the transport await it before extraInfo lookups on that session.Fetchinterception is installed before the worker is released, so nothing escapes while we wait — this blocks a request briefly rather than the debugger.CDPNetworkExtraInfoobserve the browser connection, whereNetworkis already enabled for SW targets, joining viatargetInfo.targetId. Risk: CDP request ids are per-session, so the same request may not share an id across connections.Acceptance criteria
Nothing detects this today, so the fixture is really the deliverable that decides whether 1–2 are worth building.
Set-Cookieresponse, asserting the simulated-top rewrite) fails without the fix and passes with it — or shows the case is unreachable, and the drift is documented insteadservice-worker.cy.jsstays 28/28 proxy-off on Chrome and Electron, no wall-clock regressionservice_worker_spec.js/service_worker_protocol_spec.jsstay green proxy-offsystem-tests-electron-cdp-remediatedcarries no service-worker specs — worth closing while here.