Skip to content

Fetch: preserve ReadableStream body lifecycle #407

Description

@chrisbbreuer

Parent: #406
Related: #405, #141
Roadmap: #134

Make Fetch Body objects preserve engine-native ReadableStream bodies instead of stringifying them at construction. This is the required body lifecycle beneath WebAssembly streaming compilation.

Scope

  • Store stream bodies as managed Value edges on Response and Request without eager consumption.
  • Expose realm-correct body and derived bodyUsed; distinguish null, buffered, locked, disturbed, closed, errored, and cancelled bodies.
  • Route text, JSON, ArrayBuffer, bytes, Blob, and FormData body methods through the same ABI: implement readable-stream consumption and conversions #405 consumer machinery.
  • Reject repeated, locked, errored, detached, invalid-chunk, and abrupt-pull consumption through returned Promises.
  • Preserve Content-Type inference, cloning rules, sibling realms, GC relocation, cancellation, and failure atomicity.
  • Add focused Debug, ReleaseSafe, and TSan tests without running unrelated long corpora.
  • Document the exact lifecycle contract and close only after fixing-main CI is green.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions