Open jchappe opened 2 months ago
Thank you for reporting! If this is an SDK specific issue, we will look into it and get back to you soon. If this is an API related request, report it in our Advanced API Discord instead (use this invite link if it's your first time accessing the Discord).
I believe this is because a 1001 error is not considered an unexpected connection closure and therefore the retry logic would not be triggered. See here on how ConnectionClosedOK
errors are handled vs how ConnectionClosedError
errors are handled.
Furthermore, your on_close
function is only called when you manually close the connection, not on an error.
How often are you seeing this behavior? I will raise this internally with the the team.
Receiving a Close 1001 message from websocket is not triggering the on_close function and the associated retry logic.
Here is my connection snippet:
`
And here is the logging:
2024-08-06 22:53:08 - websockets.client - DEBUG - % sending keepalive ping 2024-08-06 22:53:08 - websockets.client - DEBUG - > PING 8d 71 87 e4 [binary, 4 bytes] 2024-08-06 22:53:08 - websockets.client - DEBUG - < CLOSE 1001 (going away) [2 bytes] 2024-08-06 22:53:08 - websockets.client - DEBUG - = connection is CLOSING 2024-08-06 22:53:08 - websockets.client - DEBUG - > CLOSE 1001 (going away) [2 bytes] 2024-08-06 22:53:08 - websockets.client - DEBUG - = connection is CLOSED