brokerize / client-js

2 stars 2 forks source link

ensure that WebSocketClient does not send data before connection is established correctly #54

Closed thorbenziemek closed 10 months ago

thorbenziemek commented 10 months ago

The sendWs function (https://github.com/brokerize/client-js/blob/main/src/websocketClient.ts#L130-L146) does not check for readyState currently (note the idea is that callers make sure the connection is ready), which sometimes leads to messages being sent to a non-ready connection.

This should be fixed and probably refactored.