Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always capture header in ConnectError #924

Merged
merged 4 commits into from
Nov 24, 2023
Merged

Conversation

srikrsna-buf
Copy link
Member

@srikrsna-buf srikrsna-buf commented Nov 22, 2023

In server streaming for all protocols and unary for gRPC/gRPC-Web if an error occurs after the headers are received ConnectError.metadata doesn't include them. Instead they are only part of the onHeader callback.

We change the behavior to always capture header in ConnectError.

This was caught by the new conformance tests for client in #890.

Copy link
Member

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

Makes sense to me to do the same as connect-go. Looks like a legit fix to me 👍

Can you explain the change for users in the PR description?

One question from me, see comments below.

packages/connect-web/src/grpc-web-transport.ts Outdated Show resolved Hide resolved
packages/connect/src/protocol-grpc-web/transport.ts Outdated Show resolved Hide resolved
packages/connect/src/protocol-grpc/transport.ts Outdated Show resolved Hide resolved
@srikrsna-buf srikrsna-buf changed the title Capture header in ConnecError for gRPC unary call Always capture header in ConnecError Nov 24, 2023
@srikrsna-buf srikrsna-buf merged commit 2993118 into main Nov 24, 2023
4 checks passed
@srikrsna-buf srikrsna-buf deleted the sk/grpc-error-headers branch November 24, 2023 11:09
@smaye81 smaye81 mentioned this pull request Dec 1, 2023
@smaye81 smaye81 changed the title Always capture header in ConnecError Always capture header in ConnectError Dec 1, 2023
@smaye81 smaye81 mentioned this pull request Dec 1, 2023
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.

2 participants