saket / telephoto

Building blocks for designing media experiences in Compose UI
https://saket.github.io/telephoto/
Apache License 2.0
996 stars 32 forks source link

Coil returned a null cache snapshot #69

Closed kasem-sm closed 6 months ago

kasem-sm commented 8 months ago

Device - Pixel 7A, Android 14 Here is the stackrace,


       at me.saket.telephoto.zoomable.coil.Resolver.toSubSamplingImageSource(CoilImageSource.kt:135)
       at me.saket.telephoto.zoomable.coil.Resolver.work(CoilImageSource.kt:110)
       at me.saket.telephoto.zoomable.coil.Resolver$work$1.invokeSuspend(CoilImageSource.kt:1)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:32)
       at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
       at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:235)
       at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:191)
       at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:163)
       at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:474)
       at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:508)
       at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:497)
       at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:368)
       at kotlinx.coroutines.ResumeAwaitOnCompletion.invoke(ResumeAwaitOnCompletion.java:1406)
       at kotlinx.coroutines.JobSupport.notifyCompletion(JobSupport.kt:1497)
       at kotlinx.coroutines.JobSupport.completeStateFinalization(JobSupport.kt:325)
       at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:242)
       at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:910)
       at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:867)
       at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:832)
       at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
       at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:270)
       at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:102)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:205)
       at android.os.Looper.loop(Looper.java:294)
       at android.app.ActivityThread.main(ActivityThread.java:8248)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)`
saket commented 8 months ago

Could this be related to https://github.com/saket/telephoto/issues/37?

kasem-sm commented 8 months ago

Hmm.., Seems so. This was also a rare crash while testing, and I haven't moved it to production yet. I will try to reproduce the crash and let you know.

saket commented 6 months ago

Merging this with https://github.com/saket/telephoto/issues/37.

saket commented 6 months ago

This should be fixed by v0.11.2. ZoomableAsyncImage() will now reload images if the disk cache is found empty.