Skip to content

fix(storage): Invocation ID is not retained on multipart upload retries#8190

Open
thiyaguk09 wants to merge 4 commits intogoogleapis:storage-node-18from
thiyaguk09:fix/multipart-invocation-id
Open

fix(storage): Invocation ID is not retained on multipart upload retries#8190
thiyaguk09 wants to merge 4 commits intogoogleapis:storage-node-18from
thiyaguk09:fix/multipart-invocation-id

Conversation

@thiyaguk09
Copy link
Copy Markdown
Contributor

Hoists the generation of persistentInvocationId to the beginning of the
upload process in Bucket.upload and File.save. This ensures that retried multipart upload attempts reuse the same invocation ID in the x-goog-api-client header, rather than generating a new one for each attempt.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Hoists the generation of `persistentInvocationId` to the beginning of
the
upload process in `Bucket.upload` and `File.save`. This ensures that
retried multipart upload attempts reuse the same invocation ID in the
`x-goog-api-client` header, rather than generating a new one for
each attempt.
@thiyaguk09 thiyaguk09 requested a review from a team as a code owner May 6, 2026 12:56
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 6, 2026
@thiyaguk09 thiyaguk09 requested review from a team as code owners May 6, 2026 12:58
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements persistent invocationId tracking across the upload lifecycle and refactors the StorageTransport.makeRequest method to improve project ID resolution and header management. Feedback focuses on critical issues in the makeRequest refactor, including a bug where the request body is incorrectly assigned to an undefined property, thread-safety risks from unconditionally clearing shared interceptors, and an inconsistent response handler that mutates data and breaks return type expectations.

Comment thread handwritten/storage/src/storage-transport.ts Outdated
Comment thread handwritten/storage/src/storage-transport.ts
Comment thread handwritten/storage/src/storage-transport.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant