You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
As of now, mali inspects the type of call constructor of context request/response object in grpc server implementation, as we can see below:
function getCallTypeFromCall (call) {
const name = Object.getPrototypeOf(call).constructor.name
if (name.indexOf('ServerUnaryCall') === 0) {
return CallType.UNARY
} else if (name.indexOf('ServerWritableStream') === 0) {
return CallType.RESPONSE_STREAM
} else if (name.indexOf('ServerReadableStream') === 0) {
return CallType.REQUEST_STREAM
} else if (name.indexOf('ServerDuplexStream') === 0) {
return CallType.DUPLEX
}
}
However, an update to the @grpc/grpc-js package 2 months ago modified the unary call handler to use ServerWritableStreamImpl instead of ServerUnaryCallImpl. Consequently, Mali now mistakenly identifies all unary calls as stream calls.
To Reproduce
Steps to reproduce the behavior:
Install newest grpcjs package as peer dependency, and make unary call to mali instance.
Expected behavior
It should differentiate the unary and stream calls separately as intended.
Environment
Version: 0.47.1
Node.js version: 20
OS: macOS 14.0(23A344)
The text was updated successfully, but these errors were encountered:
to resolve the issue, we can modify getCallTypeFromCall to reference call.call.handler.type. it is defined in type 'bidi' | 'clientStream' | 'serverStream' | 'unary'.
hey, @anonrig just reminding about this issue, as it's already merged, could you please release this fix, it would be really helpful as it's blocking usage of the latest grpc-js version for half a year.
Describe the bug
As of now, mali inspects the type of call constructor of context request/response object in grpc server implementation, as we can see below:
However, an update to the @grpc/grpc-js package 2 months ago modified the unary call handler to use ServerWritableStreamImpl instead of ServerUnaryCallImpl. Consequently, Mali now mistakenly identifies all unary calls as stream calls.
To Reproduce
Steps to reproduce the behavior:
Install newest grpcjs package as peer dependency, and make unary call to mali instance.
Expected behavior
It should differentiate the unary and stream calls separately as intended.
Environment
The text was updated successfully, but these errors were encountered: