Skip to content

cloning byte readablestream causes process to hang #51944

Closed
@KhafraDev

Description

Version

v21.6.2

Platform

n/a

Subsystem

webstreams

What steps will reproduce the bug?

function cloneBody (body) {
  const [out1, out2] = body.stream.tee()
  const out2Clone = structuredClone(out2, { transfer: [out2] })
}

const rs = new ReadableStream({
  pull (controller) {
    controller.byobRequest?.respond(0)
  },
  type: 'bytes'
})

cloneBody({ stream: rs })

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

the process to close automatically

What do you see instead?

the process hangs

Additional information

this is needed for fetch.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions