supabase-kt: [Bug]: Realtime Websocket Connection Crashes
General Info
- I checked for similar bug report
- I am using the latest version
- I checked the troubleshooting page for similar problems
Version(s)
3.0.1
Kotlin Target(s) and their respective versions
Android 14, 13
What happened? (include your code)
I am seeing these in my crashlytics with a huge frequency, and the only place I use websockets are supabase realtime, anyidea where these are happening, and the place to handle these ?
Fatal Exception: java.net.SocketException: Software caused connection abort
at java.net.SocketInputStream.socketRead0(SocketInputStream.java)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:118)
at java.net.SocketInputStream.read(SocketInputStream.java:173)
at java.net.SocketInputStream.read(SocketInputStream.java:143)
at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:985)
at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:949)
at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readUntilDataAvailable(ConscryptEngineSocket.java:864)
at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.read(ConscryptEngineSocket.java:837)
at okio.InputStreamSource.read(InputStreamSource.java:93)
at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:153)
at okio.RealBufferedSource.request(RealBufferedSource.kt:211)
at okio.RealBufferedSource.require(RealBufferedSource.kt)
at okio.RealBufferedSource.readByte(RealBufferedSource.kt:214)
at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119)
at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102)
at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293)
at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Steps To Reproduce (optional)
No response
Relevant log output (optional)
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (2 by maintainers)
@TiagoLira, yea we can do that. Opened up a PR: https://github.com/supabase-community/supabase-kt/pull/848 Will release a minor version later today, let me know if you get any more crashes after this version!
Hi @jan-tennert sorry to reopen, but our users are having crashes similar to the first SocketException above. The error happens every time when the device loses internet connection, you can try it by turning off wifi while the socket is open.
It seems to be a non-fatal error on most devices, but according to crashlytics it’s crashing the app on some Samsung devices. I’ve looked on okio forums and according to this thread, it’s an exception that must be handled by clients. https://github.com/square/okio/issues/1167
We have error handling on all realtime code, but it doesn’t catch it. Can you please check if the exception can be handled on your side?
Here is the stack trace:
And the device models where it is crashing, according to crashlytics: