-
Couldn't load subscription status.
- Fork 232
Open
Labels
Description
Currently the mint driver doesn't process multiple messages in a single body frame.
Only have it when connecting through a nginx proxy that seems to buffer body messages and puts them in like a single body.
It works correctly with the gun adapter.
But the mint adapter puts the code in a buffer but then never consumes the data causing messages to not be returned.
For fix I would say you should either directly process all finished messages in the body.
Or return with the consume that there are more messages so you can call it again to process the remaining buffer.
It's in lib/grpc/client/adapters/mint/stream_response_process.ex
def handle_call({:consume_response, {:data, data}}, _from, state) do
%{
buffer: buffer,
grpc_stream: %{response_mod: res_mod, codec: codec},
responses: responses
} = state
case GRPC.Message.get_message(buffer <> data, state.compressor) do
{{_, message}, rest} ->
# TODO add code here to handle compressor headers
response = codec.decode(message, res_mod)
new_responses = [{:ok, response} | responses]
new_state = %{state | buffer: rest, responses: new_responses}
{:reply, :ok, new_state, {:continue, :produce_response}}
_ ->
new_state = %{state | buffer: buffer <> data}
{:reply, :ok, new_state, {:continue, :produce_response}}
end
end
sleipnir