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

KuCoin token is expired error when reconnecting after running for 24 hours #4740

Open
rachid-o opened this issue Jul 13, 2023 · 0 comments
Open

Comments

@rachid-o
Copy link
Contributor

rachid-o commented Jul 13, 2023

I'm testing the KuCoin WebSockets implementation of xchange-stream-kucoin version 5.1.1-SNAPSHOT. Retrieving market data works fine. The WebSocket connection is created using a token that is valid for 24 hours. When there's a connection reset, XChange automatically reconnects the WebSocket using the same token. So far so good.

Only when the process is running for more than 24 hours XChange can't reconnect anymore because it uses a token that is expired. The reconnect will result in: handleError cannot parse channel from message: {"type":"error","code":401,"data":"token is expired"}

It would be nice if the XChange library would reconnect using a new token in this case. So I think it should first GET a new token via REST before connecting to WebSocket again. In my code I now implemented a work-around which disconnects and sets up a new connection (automatically with new token) every 24 hours.

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

No branches or pull requests

1 participant