Kaaveh / ComposeNews

A playground about best practices, using updated libraries and solutions in the Android world!
Apache License 2.0
282 stars 47 forks source link

Crash on switching btw BottomBar tabs #185

Closed jalalaghazadeh closed 4 months ago

jalalaghazadeh commented 8 months ago

A crash can happen when you switch btw button-bar tabs several times. here is a StackTrace:


Process: ir.composenews, PID: 8708
retrofit2.HttpException: HTTP 429 
at retrofit2.KotlinExtensions$await$2$2.onResponse(KotlinExtensions.kt:53)
at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:161)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@4ef69d2, Dispatchers.Main.immediate]```
Kaaveh commented 8 months ago

Hey @jalalaghazadeh , Thanks a lot for reporting! Are you willing to working on this issue?

jalalaghazadeh commented 8 months ago

Hey @jalalaghazadeh , Thanks a lot for reporting! Are you willing to working on this issue?

Hey @Kaaveh , that would be my pleasure. I'll send a MR asap.

Kaaveh commented 8 months ago

@jalalaghazadeh Awesome! I'll assign this issue to you! 🙌🏻

Kaaveh commented 6 months ago

Hey @jalalaghazadeh Do you have any updates on this task?

jalalaghazadeh commented 6 months ago

Hey @jalalaghazadeh Do you have any updates on this task?

I did some debugging on the matter and it was due to not handling http exceptions in which can be handled in a interceptor in process of building OkHttpClient object. there was a lot going on and I lost track of this one :(