Skip to content

Conversation

chris-olszewski
Copy link
Member

@chris-olszewski chris-olszewski commented Oct 2, 2025

What was changed

Added ability to send binary gRPC headers via NativeConnection.

Also added a test to verify that binary headers were accepted by Connection.

Why?

Make progress on temporalio/features#671

Checklist

  1. Closes [Feature Request] Ensure gRPC binary metadata headers are supported #1778

  2. How was this tested:
    Added setting and sending of binary headers at both the client and call level for both native and the standard client connection.

  3. Any docs updates needed?
    I believe the type expansion from string to string | Buffer is the only user facing change and that change should appear in the API reference.

Each commit is reviewable on its own.

@chris-olszewski chris-olszewski force-pushed the olszewski/feat_grpc_bin_headers branch from fa18a14 to 2235a4f Compare October 3, 2025 13:25
let value = obj.get_value(cx, key_handle)?;
map.insert(key, T::try_from_js(cx, value)?);
let js_value = obj.get_value(cx, key_handle)?;
let value = T::try_from_js(cx, js_value).field(&key)?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improves the error message slightly by indicating which field on the object had the type issue

let Some(headers) = headers else {
return (None, None);
};
let mut ascii_headers = HashMap::default();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible optimization is to create the hashmap with the same capacity as the initial headers map. Only downside I could see would be if the headers were mostly binary.

@chris-olszewski chris-olszewski force-pushed the olszewski/feat_grpc_bin_headers branch from 1b17bc4 to def0d6c Compare October 3, 2025 14:45
@chris-olszewski chris-olszewski force-pushed the olszewski/feat_grpc_bin_headers branch from def0d6c to b9ec854 Compare October 3, 2025 14:55
@chris-olszewski chris-olszewski marked this pull request as ready for review October 3, 2025 15:17
@chris-olszewski chris-olszewski requested a review from a team as a code owner October 3, 2025 15:17
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.

[Feature Request] Ensure gRPC binary metadata headers are supported
1 participant