Closed saibotma closed 2 months ago
Thanks for filing an issue! I don’t think this is an issue since cancelOnError is true and we should catch the error and attempt to reconnect as is. Happy to look at a simple reproduction sample if you have one that illustrates incorrect behavior though, thanks!
Closing for now since there are no actionable next steps without a reproduction sample.
I did not test this or experience a bug, but after looking at the source code, I noticed that an error emitted by the web socket channel or thrown inside listen never gets handled.
Due to
onDone
not getting called, when the stream gets cancelled because of an error,attemptToReconnect
will never be called in this case. In addition to that, an error thrown insidelisten
will put the web socket client in a kind of zombie state, because the error isn't propagated up and never handled insidelisten
.So from my point of view the solutions would be:
onError
and callattemptToReconnect
in it.listen
in a try catch and callattemptToReconnect
inside catch.I could be wrong, but wanted to point this out.