Skip to content

fix(storage): resolve transport and retry issues#8235

Open
thiyaguk09 wants to merge 53 commits into
googleapis:storage-node-18from
thiyaguk09:storage-transport-retry-fix
Open

fix(storage): resolve transport and retry issues#8235
thiyaguk09 wants to merge 53 commits into
googleapis:storage-node-18from
thiyaguk09:storage-transport-retry-fix

Conversation

@thiyaguk09

Copy link
Copy Markdown
Contributor

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> 🦕

@thiyaguk09 thiyaguk09 requested review from a team as code owners May 7, 2026 12:00
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 7, 2026

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

Copy link
Copy Markdown
Contributor

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 refactors request handling and retry logic by transitioning from the common Service class to a specialized StorageTransport. Key changes include the introduction of granular idempotency logic for HTTP methods, improved encryption header management, and a custom parameter serializer. Review feedback identifies a high-severity race condition involving shared interceptors on the Gaxios instance and inconsistent return types in the response handler. Additionally, improvements were suggested regarding the efficiency of JSON parsing within retry loops and the safety of non-null assertions in encryption headers.

Comment thread handwritten/storage/src/storage-transport.ts Outdated
Comment thread handwritten/storage/src/storage-transport.ts Outdated
Comment thread handwritten/storage/src/storage.ts Outdated
Comment thread handwritten/storage/src/file.ts Outdated
thiyaguk09 and others added 2 commits May 7, 2026 17:49
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
…e etag check

- Updated `responseHandler` to correctly handle different payload types:
- Plain objects are mutated with `.headers` and `.status` and
returned.
- Binary payloads (Buffer/Stream) return raw data to prevent dangerous
mutations.
- Primitives (e.g., empty strings) return the full `GaxiosResponse`
wrapper to preserve access to headers like `Location` for resumable
upload initiation.
- Fixed `hasPrecondition` logic to safely parse stringified JSON or
inspect objects directly for an `etag` property. This prevents false
positives on raw text payloads containing the word "etag" and false
negatives on object payloads.
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
Comment thread handwritten/storage/src/file.ts Outdated
Comment thread handwritten/storage/src/nodejs-common/service-object.ts
Comment thread handwritten/storage/src/file.ts Outdated
@thiyaguk09 thiyaguk09 requested a review from Dhriti07 May 27, 2026 09:06
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
…sport (googleapis#8283)

- Remove Service.ts and common.ts files from handwritten/storage

- Migrate remaining functionality to StorageTransport

- chore(ci): upgrade conformance tests to Node 18
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.

2 participants