-
Notifications
You must be signed in to change notification settings - Fork 289
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
potential client bug after 0.3.4 when sending slightly larger first message #230
Comments
* Introduces a flat schema for all messages. * Subscription message moved to gdax module. * Fixes bad call to logging module in ws4py implementation. * Reverted to ws4py 0.3.4 due to [possible bug](Lawouach/WebSocket-for-Python#230) in other recent releases.
I'm having a similar issue with 0.4.3 trying to use the Bitfinex v2 API: It happens almost every time you try to start multiple subscriptions on the same websocket. |
Apparently, it gets broken in v0.3.5 onwards: v0.3.4 works, v0.3.5 and later don't |
I'm still looking into this and I see weird stuff happening after commit https://github.com/Lawouach/WebSocket-for-Python/search?q=75b88bdecd988694b0429c46cf5c3d6c719cc1f2&type=Commits&utf8=%E2%9C%93 |
I think I know what's happening: as soon as more than 1 message is in the queue, the first message is decoded, but the rest of the buffer gets thrown away. If you're "lucky" one or more entire messages are thrown away, but the socket keeps working. As soon as only part of a message is thrown away, the parser will start halfway a frame and will bail out, closing the socket. |
Damn, if you change the code (see pull request) in opened() to
You still get 'Invalid UTF-8 bytes' errors... |
…r of bytes to the parsers
proper fix for #230: on secure, only pass the requested number of bytes to the parsers
Hello! Thanks for the library.
I have been using this library to interface with the GDAX websocket feed. While upgrading to their new websocket protocol, the size of the subscription message increased. Now, I keep getting some UTF-8 error on log level DEBUG with 0.4.2 and 0.3.5:
Under 0.4.1 and 0.4.0, I don't get the UTF-8 error, but the websocket closes in the same way:
On 0.3.4, I don't get any errors.
Old subscription message:
msg = """{"type": "subscribe","product_ids":["BTC-USD"]}"""
New subscription message:
msg = """{"type": "subscribe", "product_ids": ["BTC-USD"], "channels": ["ticker", "level2"]}"""
Let me know if you need anything else.
The text was updated successfully, but these errors were encountered: