Closed SimonMarquis closed 2 months ago
Huh. Can you share the full stacktrace?
me.saket.telephoto.zoomable.RealZoomableState.fling-BMRW4eQ$zoomable_release (RealZoomableState.java:152)
me.saket.telephoto.zoomable.ZoomableNode$onTransformStopped$1$1.invokeSuspend (Zoomable.kt:152)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:9)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:93)
androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch (AndroidUiDispatcher.android.kt:15)
androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch (AndroidUiDispatcher.android.kt:15)
androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run (AndroidUiDispatcher.android.kt:3)
android.os.Handler.handleCallback (Handler.java:907)
android.os.Handler.dispatchMessage (Handler.java:105)
android.os.Looper.loop (Looper.java:216)
android.app.ActivityThread.main (ActivityThread.java:7625)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)
We also experience this bug in our project, but I have some additional info:
I was able to reproduce crash by zooming and tapping for a long time, but it is very difficult to catch. But users experienced it quite often.
So, in my case the reason was in 1.7.0 compose-ui version. I compared VelocityTracker's source code and saw that it was the same in 1.6.4-1.6.8 versions, but changed in 1.7.0, so may be problem is here
I was wondering if we could try to detect (and drop) invalid Velocity
earlier and not send
them to prevent crashes in consumer code?
Yep let's do that. VelocityTracker#calculateVelocity()
only protects from large values, but not NaN
.
0.14.0 is out with a fix: https://github.com/saket/telephoto/releases/tag/0.14.0
This crash (2,038 crash events affecting 1,235 users) is very similar to this issue that was fixed:
The difference is in the values (
±Infinity
vsNaN
).It is happening in versions 0.11.2 and 0.12.0 (0.12.1 was not tested), no specific Android version or manufacturer.