Skip to content

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

Open
mahendra-google wants to merge 1 commit into
googleapis:mainfrom
mahendra-google:feature/add-idempotency-header
Open

feat(Storage): Add x-goog-gcs-idempotency-token idempotency header#15778
mahendra-google wants to merge 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.

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