saket / telephoto

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

NullPointerException in RealZoomableState #93

Closed G00fY2 closed 3 days ago

G00fY2 commented 3 days ago

Seems like we run into the same crash as reported in #70

java.lang.NullPointerException
    at me.saket.telephoto.zoomable.RealZoomableState.fling-BMRW4eQ$zoomable_release(RealZoomableState.kt:502)
    at me.saket.telephoto.zoomable.ZoomableNode$onTransformStopped$1$1.invokeSuspend(Zoomable.kt:136)

First of all, thanks for this library. We tried to integrate telephoto one month ago (didn't found time to report this earlier) but unfortunately run into the same NPE already reported and marked as fixed with the following setup: AGP 8.4.1, Compose 1.6.8, telephoto 0.11.2, enableStrongSkippingMode=true

We used just used ZoomableAsyncImage to load the same images which we on other screens display by using coil's SubcomposeAsyncImage. So no special use case.

Our manual QA faced this crash right when they first tried the zoom functionality. So may it's not too hard to reproduce. Since our app is closed source and we replaced telephoto with https://github.com/usuiat/Zoomable (before releasing to production), I can not provide an sample project.

saket commented 3 days ago

Our manual QA faced this crash right when they first tried the zoom functionality.

Can you share more details about your usage along with the steps your QA took to reproduce this crash?

saket commented 3 days ago

I think I have an idea about why this might be happening. Starting and ending a gesture before the content is initialized can cause a crash. I'll fix this scenario, but I'd still be interested in knowing how your QA team was reproducing the crash.

G00fY2 commented 2 days ago

Starting and ending a gesture before the content is initialized can cause a crash. I'll fix this scenario, but I'd still be interested in knowing how your QA team was reproducing the crash.

Hi @saket , cool that you already found the possible root cause. I just looked into the video of the crash provided by our QA and you seem to be right. The crash happened before the image finished loading/was displayed. So coincides with your suspected cause. 👍