sammchardy / python-kucoin

Kucoin REST and Websocket API python implementation
https://python-kucoin.readthedocs.io/en/latest/
MIT License
350 stars 148 forks source link

No subscriptions after socket ReconnectingWebsocket._reconnect #102

Closed btschwertfeger closed 1 year ago

btschwertfeger commented 2 years ago

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.