Skip to content

fix: pass headers as initial metadata to work around gRPC bug #545

Merged
dorasun merged 1 commit intogoogleads:mainfrom
dero1to:fix/metadata-interceptor-headers
Apr 15, 2026
Merged

fix: pass headers as initial metadata to work around gRPC bug #545
dorasun merged 1 commit intogoogleads:mainfrom
dero1to:fix/metadata-interceptor-headers

Conversation

@dero1to
Copy link
Copy Markdown
Contributor

@dero1to dero1to commented Apr 15, 2026

Fixes #544

Summary

  • Work around gRPC Ruby bug (Missing interceptor changes to metadata for streaming requests(Ruby) grpc/grpc#22448) where interceptor metadata changes are silently dropped when return_op: true is used
  • Return developer-token, login-customer-id, and linked-customer-id from ServiceLookup#headers as initial metadata instead of relying solely on MetadataInterceptor
  • Fix minor indentation in MetadataInterceptor (unrelated cleanup)

Details

gapic-common calls gRPC with return_op: true, which causes merge_metadata_to_send to run before interceptors execute. This means MetadataInterceptor's metadata modifications are lost, resulting in DEVELOPER_TOKEN_PARAMETER_MISSING errors.

This change passes the headers via gax's metadata option (set at client initialization), which bypasses the interceptor ordering issue. MetadataInterceptor is kept as-is for backward compatibility and can be cleaned up once the upstream fix (grpc/grpc#42073) is released.

…rpc#22448)

MetadataInterceptor headers are silently dropped when gapic-common uses
return_op: true. Return developer-token, login-customer-id, and
linked-customer-id from ServiceLookup#headers as a workaround.
@dero1to dero1to requested a review from a team as a code owner April 15, 2026 12:32
@dero1to dero1to requested review from BenRKarl and dorasun April 15, 2026 12:32
@google-cla
Copy link
Copy Markdown

google-cla bot commented Apr 15, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@dorasun dorasun merged commit 604d064 into googleads:main Apr 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MetadataInterceptor headers silently dropped due to gRPC return_op: true bug

2 participants