Tinder / Scarlet

A Retrofit inspired WebSocket client for Kotlin, Java, and Android
Other
3.23k stars 237 forks source link

Should retry set to true by default #221

Open georgi-mirchev opened 1 year ago

georgi-mirchev commented 1 year ago

https://github.com/Tinder/Scarlet/blob/a4764208951b7d07a7e54137d6c07df64ba3d64d/scarlet-protocol-websocket-okhttp/src/main/java/com/tinder/scarlet/websocket/okhttp/OkHttpWebSocketChannel.kt#L110

What is this? This InnerWebSocketListener() is not injected but rather created in the OkHttpWebSocketChannel.open() function. This leads to the behavior where shouldRetry is always set to true but there are cases where this should be false. Like a 404 response for an example. Why do you need to retry when the URL cannot be found? This needs to be done in a configurable manner meaning InnerWebSocketListener() should be injected and not created inside the function.