Skip to content

@tus/server: body stream errors can leave writeToStore hanging #870

Description

@Murderlon

Steps to reproduce

Pass a request body to handleWeb whose ReadableStream errors asynchronously while writeToStore is consuming it.

writeToStore currently swallows the nodeStream error and passes nodeStream.pipe(proxy) to pipeline(). Since .pipe() returns proxy and does not forward source errors, the proxy and datastore write can remain open indefinitely.

Expected behavior

The write rejects and all stream/timer/listener cleanup runs.

Actual behavior

The pipeline can remain pending because neither an error nor EOF reaches proxy.

Investigation direction

Forward source errors into the proxy/pipeline while preserving the existing behavior that avoids destroying the underlying request stream. Add coverage using an asynchronously errored web ReadableStream.

Noticed while reviewing #858; the behavior predates that PR.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions