Skip to content

grpc-js: Ensure server interceptors work with builder utility classes#2696

Merged
murgatroid99 merged 1 commit intogrpc:@grpc/grpc-js@1.10.xfrom
murgatroid99:grpc-js_server_interceptors_fix
Mar 26, 2024
Merged

grpc-js: Ensure server interceptors work with builder utility classes#2696
murgatroid99 merged 1 commit intogrpc:@grpc/grpc-js@1.10.xfrom
murgatroid99:grpc-js_server_interceptors_fix

Conversation

@murgatroid99
Copy link
Copy Markdown
Member

The idea with the part of the code modified here is that the user can pass in a partially filled in responder or server listener, and the rest of the object will be filled in with defaults so that the rest of the class can handle it more simply. Unfortunately, the specific strategy of doing that using the spread operator (...) works with unpopulated object fields, but not object fields set to undefined, which is what ResponderBuilder and ServerListenerBuilder produce.

The test auth interceptor partially populates both a listener and a resolver, so switching it to use the builders should ensure that it catches this problem on both sides.

@sergiitk
Copy link
Copy Markdown
Member

Makes sense

@murgatroid99 murgatroid99 merged commit c1df94e into grpc:@grpc/grpc-js@1.10.x Mar 26, 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.

3 participants