When utilizing two separate WebSocket connections (trades and bookTickers), terminating one with binance.websockets.terminate(pair) causes the other to close as well, despite them being distinct. Additionally, this behavior is observed even when the node-binance-api.js file is duplicated and used separately for each WebSocket.
Steps to Reproduce:
Initialize two separate WebSocket connections: one for trades and one for bookTickers.
Use distinct instances of node-binance-api.js for each WebSocket.
Terminate one of the WebSocket connections using binance.websockets.terminate(pair).
Observe that the other WebSocket connection also closes.
Expected Behavior:
Terminating one WebSocket should not affect the other, especially when they are managed by separate instances of node-binance-api.js.
Actual Behavior:
Terminating one WebSocket connection leads to the inadvertent closure of the other.
Both WebSocket connections are set up and managed independently.
The issue persists even after ensuring separate event handlers for each connection.
I'm closing the websocket using binance.websockets.terminate(pair)
Description:
When utilizing two separate WebSocket connections (trades and bookTickers), terminating one with binance.websockets.terminate(pair) causes the other to close as well, despite them being distinct. Additionally, this behavior is observed even when the node-binance-api.js file is duplicated and used separately for each WebSocket.
Steps to Reproduce:
Expected Behavior:
Terminating one WebSocket should not affect the other, especially when they are managed by separate instances of node-binance-api.js.
Actual Behavior:
Terminating one WebSocket connection leads to the inadvertent closure of the other.
Environment:
Node version: 18.18.0 Library version: node-binance-api v0.13.0 OS: macOS 12.7
Additional Information:
Both WebSocket connections are set up and managed independently. The issue persists even after ensuring separate event handlers for each connection. I'm closing the websocket using
binance.websockets.terminate(pair)