Skip to content

Request message is empty object in server_streaming interceptors #1581

@olereidar

Description

@olereidar

Describe the bug
Interceptors with server-streaming RPCs, the request.message is just an empty object. This does not happen with unary RPCs.

I’ve seen #1429, but I don’t notice any difference between version 2.0.1 and 2.0.2.

To Reproduce

const interceptor: Interceptor = (next) => async (request) => {

  if(request.stream) {
    console.log(request.message) // logs empty js object --> {}
    toJson(request.method.input, request.message); // fails since the message is empty
  }

  if (!request.stream) {
    console.log(request.message) // logs js object with entries
    toJson(request.method.input, request.message); // works ✅
  }

  return await next(request);
};

Environment (please complete the following information):

  • @connectrpc/connect version: 2.0.4
  • @connectrpc/connect-node version: 2.0.4
  • @connectrpc/express version: 2.0.4
  • Node.js version: v22.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions