-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix screensaver crash when loading an invalid backdrop image #2567
Fix screensaver crash when loading an invalid backdrop image #2567
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still getting app crashes with this branch, including on a clean build
(I've got the image rotation time at 5 seconds to quickly cycle to bad images for testing)
ACRA caught a ExecutionException for org.jellyfin.androidtv.debug
java.util.concurrent.ExecutionException: com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
at com.bumptech.glide.request.RequestFutureTarget.doGet(RequestFutureTarget.java:217)
at com.bumptech.glide.request.RequestFutureTarget.get(RequestFutureTarget.java:130)
at org.jellyfin.androidtv.integration.dream.composable.DreamHostKt$getRandomLibraryShowcase$backdrop$1.invokeSuspend(DreamHost.kt:92)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@67e852c, androidx.compose.runtime.BroadcastFrameClock@c7a4bf5, StandaloneCoroutine{Cancelling}@7b52d8a, AndroidUiDispatcher@ec09ffb]
Caused by: com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Yup I also found that after marking the PR as ready. I believe the issue is that the try-catch should be within the |
The try-catch didn't fix it either. It still crashes, apparently the exception can't be caught. |
3f31cca
to
d67ed08
Compare
The GlideException was wrapped in a ExecutionException by the Future class. I've moved the try-catch to only run for the Glide call and catch the wrapped exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see the new error appearing in logcat, and it's been running fine for 10+ minutes (where it used to crash in 1-2)
Only nit is it reverts back to the Jellyfin background instead of transparently trying another image for a few seconds, but any crash fix is a great improvement 👍
Did you try with the |
Yeah this is something we need to fix too, I was thinking about some kind of "queue" that preloads the next item when one is already showing. This would also make sure the next item shows after exactly 30 seconds instead of 30 seconds + loading time.
IIRC Glide has a default timeout and this isn't really relevant for this problem. |
Changes
Issues