centrifuge
centrifuge copied to clipboard
client.send(data) disconnects clients on empty data
We have a problem with client.Send()
method; in client.OnSubscribe()
method, when data
is empty, client.Send(data)
causes our clients to disconnect. To prevent this, we have added a length check:
if chatAccesses := clientData.GetProtoChatAccessesData(); len(chatAccesses) > 0 {
client.Send(chatAccesses)
}
But it is much better if Centrifuge checks it.
Hello, I just tried to do it with Websocket/JSON case and centrifuge-js
– and I don't observe disconnect, could you provide details about libs?
In general sending empty data may be a valid scenario in case of binary protocol format. So possibly simply rejecting empty data is not a way to go. But I'd like to understand which disconnect happens here.
Closing since no response from the op and I have not been able to reproduce