python-kucoin icon indicating copy to clipboard operation
python-kucoin copied to clipboard

No subscriptions after socket ReconnectingWebsocket._reconnect

Open btschwertfeger opened this issue 3 years ago • 0 comments
trafficstars

Every time the ws connection closes and the socket tries to reconnect, I don't get a message because the subscriptions need to be updated as well by adding these lines into ReconnectingWebsocket.send_message function:

if msg not in self._subscriptions:
    self._subscriptions.append(msg)

and adding

for sub in self._subscriptions:
    await self._socket.send(json.dumps(sub))

into the

async with ws.connect(self._get_ws_endpoint(), ssl=self._get_ws_encryption()) as socket:

block.

btschwertfeger avatar Nov 21 '21 13:11 btschwertfeger