Skip to content

fix: drain intermediate upload responses#1551

Open
IgorGanapolsky wants to merge 1 commit intogoogleapis:mainfrom
IgorGanapolsky:codex/upstream-google-genai-1278-deno-upload-leak
Open

fix: drain intermediate upload responses#1551
IgorGanapolsky wants to merge 1 commit intogoogleapis:mainfrom
IgorGanapolsky:codex/upstream-google-genai-1278-deno-upload-leak

Conversation

@IgorGanapolsky
Copy link
Copy Markdown

@IgorGanapolsky IgorGanapolsky commented May 4, 2026

Fixes #1278.

Summary

  • cancel intermediate resumable upload response bodies when the upload status is missing and the client retries
  • cancel successful intermediate active upload response bodies before sending the next chunk
  • keep the final response body intact so callers can still parse the final JSON payload
  • cover both Node path uploads and Blob uploads in file upload unit tests

Verification

  • npx eslint src/cross/_cross_uploader.ts src/node/_node_uploader.ts test/unit/file_test.ts
  • npm run unit-test -- --filter=File

The issue reproduction reports Deno leak detection for unconsumed fetch response bodies. This patch ensures the SDK cancels upload responses it does not otherwise read.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 4, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant