-
Notifications
You must be signed in to change notification settings - Fork 28
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
IllegalStateException: maximumVelocity should be a positive value #81
Comments
Just to confirm, were you not seeing any of these crashes on an older version of telephoto? |
Can you also share your version of Compose UI? |
Oh you're right, we did have them on previous versions as well (Crashlytics groupped them differently):
Our Compose UI version is currently at 1.6.4. |
I've replaced my manual calculation of maximum velocity with the framework one in 3230987. Let's see if this fixes the issue. telephoto/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/internal/transformable.kt Lines 154 to 156 in 71b9617
I'm not certain, but #76 could also help. I'll cut a release soon. In the meantime, the changes are available in |
Thanks for these updates. Unfortunately I won't be able to use such SNAPSHOT version in the main project for now 😖 I'll try to see if we can fork and test this patch. |
I just released https://github.com/saket/telephoto/releases/tag/0.10.0. Can you please give it a try? |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto) | `0.9.0` -> `0.10.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image-coil/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image-coil/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image-coil/0.9.0/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image-coil/0.9.0/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [me.saket.telephoto:zoomable-image](https://togithub.com/saket/telephoto) | `0.9.0` -> `0.10.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image/0.9.0/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image/0.9.0/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [me.saket.telephoto:zoomable](https://togithub.com/saket/telephoto) | `0.9.0` -> `0.10.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable/0.9.0/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable/0.9.0/0.10.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>saket/telephoto (me.saket.telephoto:zoomable-image-coil)</summary> ### [`v0.10.0`](https://togithub.com/saket/telephoto/releases/tag/0.10.0) [Compare Source](https://togithub.com/saket/telephoto/compare/0.9.0...0.10.0) Bug fixes - [saket/telephoto#70, [saket/telephoto#72: Correctly update `ZoomableState` when `Modifier.zoomable()` is reused - [saket/telephoto#71: Make sure velocity tracker tracks the same pointer - [saket/telephoto#81: Read maximum fling velocity from composition locals Dependency updates - Compose compiler: 1.5.11 - Compose UI: 1.6.4 - Compose multiplatform: 1.6.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ZacSweers/CatchUp). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Our app update will be rolled-out starting next monday 🚀 |
…1339) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto) | dependencies | minor | `0.9.0` -> `0.10.0` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>saket/telephoto (me.saket.telephoto:zoomable-image-coil)</summary> ### [`v0.10.0`](https://togithub.com/saket/telephoto/releases/tag/0.10.0) [Compare Source](https://togithub.com/saket/telephoto/compare/0.9.0...0.10.0) Bug fixes - [saket/telephoto#70, [saket/telephoto#72: Correctly update `ZoomableState` when `Modifier.zoomable()` is reused - [saket/telephoto#71: Make sure velocity tracker tracks the same pointer - [saket/telephoto#81: Read maximum fling velocity from composition locals Dependency updates - Compose compiler: 1.5.11 - Compose UI: 1.6.4 - Compose multiplatform: 1.6.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yOTYuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI5Ni4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
@SimonMarquis were you able to verify if the frequency of crashes has decreased? |
It seems like it did not change anything. New reports are coming up with this new version. telephoto/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/internal/transformable.kt Line 155 in 7f88d63
The packing/unpacking of 2 floats in a long seems fine. Given the uncommon distribution of devices having this bug, this could be an OS bug. And from the docs, nothing really prevents it from being negative after all. Do you think we could try clamping these values? val maximumVelocity = currentValueOf(LocalViewConfiguration)
.maximumFlingVelocity
.coerceAtLeast(0F)
.let { Velocity(it, it) } |
Oof. Considering that I'll file a bug report. |
@SimonMarquis can you share more data about these devices, including their API versions? |
Devices:
OS:
This OS distribution makes it look like a platform bug that has been fixed in Android 11. |
It very likely is! Interestingly, @JakeWharton reminded me yesterday that we encountered a similar bug in Cash App a year ago. It's amazing that I've already run into it again. I'll file a bug report on D8, and think of a way to suppress these in telephoto. Is Android 8 your min sdk version? |
We have minSdk set to 24 (Android 7) |
I've filed a bug report on D8: https://issuetracker.google.com/u/1/issues/338381315. |
@SimonMarquis will you be able to share your apk here? https://issuetracker.google.com/issues/338381315#comment2 |
We are seeing a pretty substantial amount of errors in the latest version (0.9.0) that leads to this method:
telephoto/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/internal/transformable.kt
Line 152 in 3e0c557
And all the stacktraces look like this (with value 0.0):
or this (with a tiny value, that looks like a 0 approximation in float):
I'm not sure why it would throw here to be honest, since we always provide sane values
Velocity(Int.MAX_VALUE.toFloat(), Int.MAX_VALUE.toFloat())
. Could this be an issue with the devices packing floats incorrectly?The device repartition is as follow:
The text was updated successfully, but these errors were encountered: