Hi there!
When using
api.streamInOut<RequestInterface, ResponseInterface>(...)
there is an issue with how incoming messages are handled.
If the client sends a message that does not fully match the declared RequestInterface, it never reaches the polling loop:
for await (const message of this.#stream) {
...
}
For example, given:
interface RequestInterface {
prop1: string;
prop2: string;
}
and the client sends:
await stream.send({ prop1: "test" });
the message is successfully sent to the socket, but Encore silently ignores it. No warnings or errors are triggered, making the issue hard to debug.
This results in the server never receiving the message in the stream loop, even though it was transmitted.