ditto-clients
ditto-clients copied to clipboard
[JS] Buffered WebSocket client sends messages before being connected
The buffered implementation for WebSockets has bug that it will try to send the buffered messages to the WebSocket before the WebSocket has finished connecting.
From what I can observe now, the problematic code can be found in StandardResilienceHandler#addToOutstandingBuffer. In this function, an outstanding request is added to the buffer and a timeout is started for calling #poll()
. The #poll()
function however does not verify if this.webSocket
is already initialized.
In case the connection takes longer than the initial timeout of 500ms
, this.requestBuffer#sendNectOutstanding
will be called with an undefined
WebSocket and crash.