Skip to content

feat(Storage): Add x-goog-gcs-idempotency-token idempotency header - #15778

Merged
krishnamd-jkp merged 1 commit into
googleapis:mainfrom
mahendra-google:feature/add-idempotency-header
Sep 16, 2026
Merged

krishnamd-jkp merged 1 commit into
googleapis:mainfrom
mahendra-google:feature/add-idempotency-header

Conversation

@mahendra-google

@mahendra-google mahendra-google commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This PR contains only the first part of the feature request i.e. Add request idempotency header to each JSON API request and add a unit test for this. Please see b/280811916 for reference.

This PR implements automatic injection of the x-goog-gcs-idempotency-token header for retriable requests. This ensures that retries of the same request are recognized as identical by the server, preventing duplicate operations.

@mahendra-google
mahendra-google requested review from a team as code owners July 23, 2026 09:31
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jul 23, 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 introduces an automatic idempotency token header (x-goog-gcs-idempotency-token) for retriable Google Cloud Storage requests. It implements IdempotencyTokenInterceptor to inject a unique GUID as the token if the header is not already present, and registers this interceptor in RetryHandler. Additionally, a unit test has been added to verify that the idempotency header is correctly set and remains consistent across retried requests. There are no review comments, and I have no further feedback to provide.

@amanda-tarafa amanda-tarafa 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.

LGTM, but please get someone from the Storage team to review.

@mahendra-google
mahendra-google force-pushed the feature/add-idempotency-header branch from d3d3b80 to d720432 Compare September 16, 2026 10:15
@krishnamd-jkp
krishnamd-jkp merged commit 7b7b3c6 into googleapis:main Sep 16, 2026
21 checks passed
google-cloud-sdk-librarian-dotnet-robot added a commit that referenced this pull request Sep 17, 2026
### New features

- Add idempotency header (#15778)

Librarian-Release-Library: Google.Cloud.Storage.V1
Librarian-Release-Version: 4.16.0
Librarian-Release-ID: release-20260917T182808Z
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.

3 participants