Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions storage/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ func (c *grpcStorageClient) ListObjects(ctx context.Context, bucket string, q *Q
}
if s.userProject != "" {
ctx = setUserProjectMetadata(ctx, s.userProject)
it.ctx = ctx
Comment on lines 559 to +561
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.

medium

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.

}
fetch := func(pageSize int, pageToken string) (token string, err error) {
// Add trace span around List API call within the fetch.
Expand Down
Loading