Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] Buffered WebSocket client sends messages before being connected #158

Open
ffendt opened this issue May 26, 2021 · 0 comments
Open

[JS] Buffered WebSocket client sends messages before being connected #158

ffendt opened this issue May 26, 2021 · 0 comments

Comments

@ffendt
Copy link
Contributor

ffendt commented May 26, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants