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

V2: Use Stream{Request|Response} types in interceptors for all streaming rpcs #1230

Merged
merged 2 commits into from
Sep 13, 2024

Conversation

srikrsna-buf
Copy link
Member

In v1 the server used more exact types in interceptors, for example UnaryRequest for server streaming rpcs. The client always used streaming variants. This is inconsistent and was unintended.

This change unifies the behavior, now all streaming rpcs will use the StreamRequest and StreamResponse on the server as well. This is breaking change.

…g rpcs

Signed-off-by: Sri Krishna Paritala <skrishna@buf.build>
@@ -140,7 +140,7 @@ export interface StreamResponse<
readonly message: AsyncIterable<MessageShape<O>>;
}

interface RequestCommon<I extends DescMessage, O extends DescMessage> {
export interface RequestCommon<I extends DescMessage, O extends DescMessage> {
Copy link
Member

Choose a reason for hiding this comment

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

Nice clean up.

Can you mark the two new exports as @private? They are not exported in the package, but this makes it unmistakably clear that they shouldn't be.

Signed-off-by: Sri Krishna Paritala <skrishna@buf.build>
@srikrsna-buf srikrsna-buf merged commit ab1b7c2 into v2 Sep 13, 2024
45 checks passed
@srikrsna-buf srikrsna-buf deleted the sk/intercetor branch September 13, 2024 11:06
@timostamm timostamm mentioned this pull request Sep 20, 2024
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