Skip to content

When cancelling an H3 event stream, while running on deno, an uncaught exception is thrown #1375

Description

@dyeske61283

Environment

H3 Version:
h3@^2.0.1-rc.20 (but this is true for any version >= 2.0)
Deno Version:
deno 2.7.12

Reproduction

I set up a repro here

Describe the bug

When a client of an event stream running on h3 + deno closes the stream, an uncaught exception is thrown, because per WHATWG Streams, cancelling a TransformStream's readable errors its writable with the same reason. writer.closed therefore rejects with the string "resource closed".

I initially raised this bug with deno and their bot did an awesome write-up of what is happening and what a fix looks like. See denoland/deno#33166

I can open up a PR with the proposed fix as well. Locally, I verified already, that it does solve the uncaught exception.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions