fix(requester pays): Set context in grpc client if user project is set for ListObjects#14449
fix(requester pays): Set context in grpc client if user project is set for ListObjects#14449meet2mky wants to merge 1 commit intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the ListObjects method in storage/grpc_client.go to ensure the iterator's context includes the userProject metadata. Feedback suggests refactoring the logic to prepare the context before the iterator is initialized, which would improve maintainability and ensure consistency with other methods in the codebase.
| if s.userProject != "" { | ||
| ctx = setUserProjectMetadata(ctx, s.userProject) | ||
| it.ctx = ctx |
There was a problem hiding this comment.
To improve maintainability and robustness, consider ensuring the context is fully prepared with all necessary metadata (such as the userProject) before the iterator is initialized. This avoids the need for manual field updates and reduces the risk of the iterator's internal state becoming out of sync with the local context variable. Moving this logic before the initialization of it would also align with the pattern used in other methods like ListBuckets.
No description provided.