- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 61
Open
Description
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)
daunJung-dev, jspranger, diogotorres97 and fabiosangregorio
Metadata
Metadata
Assignees
Labels
No labels