test: reproduce Node 25 upload duplex failure - #949
Draft
KnightNiwrem wants to merge 1 commit into
Draft
KnightNiwrem wants to merge 1 commit into
KnightNiwrem wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR was primarily written by GPT-5.6 Sol xhigh in ChatGPT Work.
Summary
This test-only draft PR adds a Node 25 CI reproduction for file uploads through the public API:
Apiinstanceapi.sendDocumenthttps://grammy.dev/images/Y.svgthroughInputFileThe local TypeScript source is bundled first so that the request itself is executed by Node 25 rather than Deno.
Current result
The
sendDocumentcall fails before making a network request:Node rejects the multipart
ReadableStreamrequest body because the generatedRequestInitdoes not containduplex: "half".Why this reproduction matters
The v2 branch changed from
node-fetchto Node's nativefetchimplementation backed by Undici. It might therefore appear that the previous duplex handling is no longer necessary or that Undici supplies it automatically.This reproduction demonstrates that the runtime change did not solve the requirement. Node 25's Undici still rejects grammY's streaming multipart body unless
duplex: "half"is present.The corresponding default was added on
mainby #913. The behavior covered by that fix remains necessary in v2 despite the fetch implementation change.The placeholder token and chat identifier are never validated because request construction fails before any connection is attempted.
Purpose
This PR intentionally contains no production fix. It exists so CI can record the failure through the normal
Api.sendDocumentpath and so the appropriate v2 fix can be discussed separately. It should not be merged in its current failing state.