feat(storage): add x-goog-gcs-idempotency-token header linked to gccl…#28
feat(storage): add x-goog-gcs-idempotency-token header linked to gccl…#28thiyaguk09 wants to merge 6 commits into
Conversation
…-invocation-id for request tracking
There was a problem hiding this comment.
Code Review
This pull request adds the x-goog-gcs-idempotency-token header to outgoing requests in Service, Util, and Upload classes, ensuring it matches the gccl-invocation-id for tracking and idempotency. However, the current implementation in Service can overwrite or duplicate user-provided idempotency tokens due to case-sensitivity issues. It is recommended to check for existing user-provided tokens, respect them, and align them with the invocation ID as suggested.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…e with gccl-invocation-id header
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for the x-goog-gcs-idempotency-token header, aligning it with the gccl-invocation-id value across the Service, Util, and Upload classes, and adds corresponding test coverage. The feedback points out a potential runtime crash in resumable-upload.ts where this.customRequestOptions is accessed directly without optional chaining; using optional chaining is recommended to prevent TypeError exceptions if the options are undefined.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…ining for idempotency token access
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces changes to align the 'x-goog-gcs-idempotency-token' header with the 'gccl-invocation-id' in the 'x-goog-api-client' header, supporting user-provided tokens case-insensitively across various request paths and resumable uploads. The review feedback highlights a critical improvement opportunity: the code should explicitly validate that the user-provided token is a string before using it, falling back to a generated UUID if it is invalid (e.g., null or undefined), to prevent type mismatches and ensure consistent header values.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…k to generating a UUID
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request aligns the "x-goog-gcs-idempotency-token" header with the "gccl-invocation-id" in the "x-goog-api-client" header across service requests, utility headers, and resumable uploads, while also supporting user-provided tokens. The review feedback identifies a high-severity issue where invalid user-provided tokens with non-standard casing are not cleaned up, resulting in duplicate or conflicting headers being sent. The reviewer provides actionable code suggestions to delete the invalid casing keys when falling back to a generated token.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
… token to prevent conflicts
|
/Gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for aligning the x-goog-gcs-idempotency-token header with the gccl-invocation-id in the x-goog-api-client header, respecting user-provided tokens case-insensitively and falling back to a generated UUID when necessary. The review feedback highlights critical issues in resumable-upload.ts where invalid or empty user-provided tokens are not properly cleaned up before merging, which could overwrite the generated UUIDs. It is recommended to delete invalid tokens directly from this.customRequestOptions.headers and to improve type safety in service.ts by explicitly checking for non-empty strings.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…al logic during resumable uploads
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:
Fixes #<issue_number_goes_here> 🦕