Skip to content

Add readable response and FetchEvent vertical - #298

Merged
wieslawsoltes merged 3 commits into
mainfrom
feature/readable-fetch-event-266
Sep 17, 2026
Merged

wieslawsoltes merged 3 commits into
mainfrom
feature/readable-fetch-event-266

Conversation

@wieslawsoltes

@wieslawsoltes wieslawsoltes commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Problem

The service-worker control plane can activate and claim a Code OSS webview, but WebScene has no readable response body or FetchEvent.respondWith() vertical. A controlled resource therefore cannot return even a static streamed response, and snapshot-created iframe realms omit the fetch globals entirely.

Change

  • add WebIDL-shaped ReadableStream, default reader/controller, cancellation, close/error ordering, locking, and tee()
  • make Response own a live body stream with clone/tee and bodyUsed consumption semantics
  • add service-worker ExtendableEvent and FetchEvent with client/request attributes, waitUntil(), respondWith(), and handled
  • prove controlled synthetic 206 response dispatch and install the same body globals in top-level and nested snapshot realms
  • add a WPT-derived Chromium oracle plus native correctness, 100-cycle latency, heap, lifecycle, and queue/RSS regression gates

This is Stack A for #266. The issue stays open. Unchanged Markdown still depends on the next stacked CacheStorage empty-match/request-routing and TransformStream tranche; this PR does not claim full Code broker or product rendering acceptance.

Validation

  • service-worker-fetch: pass; 100 cycles, p95 0.208042 ms, V8 heap 1,144,292 → 1,144,292 bytes
  • service-worker-lifecycle: pass; 100 cycles, p95 6.03821 ms, registration high-water 1
  • service-worker-clients: pass; 100 cycles, p95 0.091792 ms, queue cap 256, peak RSS 49,938,432 → 63,160,320 bytes
  • native component profile: 1/1 document, 3/3 subtests, 274 ms
  • Chromium 153 oracle: 1/1 document, 3/3 subtests, 110 ms
  • V8 bootstrap extraction and Node syntax check: pass
  • git diff --check: pass

@wieslawsoltes

Copy link
Copy Markdown
Collaborator Author

Windows C2026 follow-up is now on the PR head in 823461b3.

  • Split the fetch bootstrap into three ordered raw literals: 9,545 / 9,505 / 8,637 bytes (all below the 15,000-byte portability ceiling).
  • Concatenated runtime input remains exactly 27,687 bytes with the pre-fix SHA-256 bab3ddbb6bbbeb08907ca91e65f710c5efa3950f6c32102981a529ad1da0962c.
  • Added scripts/tests/test_v8_bootstrap_literals.py plus an extractor guard so future oversized bootstrap fragments fail before MSVC compilation.
  • Passed Python regression, generated-bootstrap Node syntax check, git diff --check, and the existing native 100-cycle service-worker-fetch gate (p95 0.296 ms; heap 1,144,292 -> 1,144,292).

A local native rebuild could not regenerate because its previously cached V8 source/output tree was removed; the pushed CI run is the clean compilation gate. The unrelated pre-existing IndexedDB C2026 remains outside this PR's ownership.

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