saket / telephoto

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

IllegalStateException: Invalid velocity = (-Infinity, -Infinity) px/sec #53

Closed tananaev closed 7 months ago

tananaev commented 7 months ago

We have quite a few crashes like this from Google Play:

Exception java.lang.IllegalStateException: Invalid velocity = (-Infinity, -Infinity) px/sec
  at me.saket.telephoto.zoomable.ZoomableState.fling-BMRW4eQ$zoomable_release (ZoomableState.java:498)
  at me.saket.telephoto.zoomable.ZoomableKt$zoomable$1$zoomableModifier$2$1.invokeSuspend (Zoomable.kt:65)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:108)
  at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch (AndroidUiDispatcher.android.kt:81)
  at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch (AndroidUiDispatcher.android.kt:41)
  at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run (AndroidUiDispatcher.android.kt:57)
  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:8177)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:552)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:971)

Not sure how to reproduce, but would be good if we could somehow handle it gracefully without a crash.

saket commented 7 months ago

Thanks for reporting! The fix is available in 0.7.0-SNAPSHOT if you want to unblock yourself immediately.

saket commented 7 months ago

Released as part of 0.7.1.