-
-
Notifications
You must be signed in to change notification settings - Fork 350
fix: typeof "function" onProgressChange - fixes app crash #648
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
fix: typeof "function" onProgressChange - fixes app crash #648
Conversation
🦋 Changeset detectedLatest commit: 0abdb2d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
The error Message I got caused by this issue: Based on this it took me some time to find this PR. |
|
would love to see this merged soon |
|
Thanks for fixing, hope this is merged soon! |
|
@dohooo / @oliverloops Can you merge this in please? |
|
@dohooo Is there anything holding up this PR from being merged? |
|
We need this one 🙏 Thanks! |
|
@dohooo Thanks for merging! Is there any approximate timeline on merging the other bugfix PRs that are waiting and publishing a new release? |
What: the bug
On iOS, when running in "Release" configuration (i.e. not "development" configuration), if
onProgressChangeis a function, the app crashes. 😖On Android, similar crash. Thanks to @yannick-softwerft for providing a traceback in a comment below.
This bug was accidentally introduced in 0d2b930 (in code here)
Why
Since the callback functions in
useAnimatedReactionare automatically workletized, when running in Xcode "Release" configuration (i.e. not "development" configuration), if the variableonProgressChangeis set to a function (from within the JS thread), thentypeof onProgressChangewill be equal to"object"from within the workletized function (in the UI thread).So, the code assumes that the value is a SharedValue and attempts to set
onProgressChange.value = absoluteProgress. However, this seems to immediately cause the app to crash.My configuration
What: the fix
Remember the value for
typeof onProgressChangein the JS thread (instead trying to check it from within the UI thread).App no longer crashes! And
onProgressChangeas function works correctly again!! 🥳🙌