Skip to content

fix: set duplex for streaming uploads - #950

Open
KnightNiwrem wants to merge 1 commit into
v2from
fix/node25-upload-duplex
Open

KnightNiwrem wants to merge 1 commit into
v2from
fix/node25-upload-duplex

Conversation

@KnightNiwrem

Copy link
Copy Markdown
Member

Note

This PR was primarily written by GPT-5.6 Sol xhigh in ChatGPT Work.

Summary

Add duplex: "half" to the request configuration produced for streaming multipart uploads.

The value is kept as a string literal with as const, and JSON-only API calls remain unchanged.

Why

The v2 branch changed from node-fetch to Node's native, Undici-backed fetch. That change did not automatically solve the streaming request requirement: Node 25 still rejects grammY's multipart ReadableStream body unless duplex: "half" is supplied.

Draft PR #949 reproduces the failure through a normal Api instance and api.sendDocument. The corresponding fix on main was made in #913.

Closes #949

Verification

  • deno fmt --check src/payload.ts
  • deno lint src/payload.ts
  • type-checked the resulting request configuration through src/client.ts
  • confirmed on Node 25.9.0 that Api.sendDocument completes and reaches a local HTTP endpoint exactly once without a caller-provided baseFetchConfig.duplex

@KnightNiwrem
KnightNiwrem marked this pull request as ready for review August 15, 2026 17:46
@KnorpelSenf KnorpelSenf added the v2 related to grammY 2.0 label Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 related to grammY 2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants