Page MenuHomePhabricator

[native] Fix reanimated cancelAnimation flow type
ClosedPublic

Authored by angelika on Wed, Dec 11, 6:58 AM.
Tags
None
Referenced Files
F3507264: D14098.diff
Fri, Dec 20, 8:03 PM
F3507238: D14098.id46399.diff
Fri, Dec 20, 7:55 PM
F3504880: D14098.id46461.diff
Fri, Dec 20, 11:01 AM
F3499884: D14098.id46316.diff
Fri, Dec 20, 12:26 AM
Unknown Object (File)
Thu, Dec 19, 1:16 PM
Unknown Object (File)
Wed, Dec 18, 8:18 AM
Unknown Object (File)
Tue, Dec 17, 5:27 PM
Unknown Object (File)
Fri, Dec 13, 11:17 PM
Subscribers
None

Details

Summary

I found a mistake in CancelAnimation flow type. It makes no sense it takes a number as an argument and in original ts types it takes a SharedValue: https://github.com/software-mansion/react-native-reanimated/blob/2.17.0/src/reanimated2/animation/util.ts#L281. I fixed it because I'll need this in later diff.

Test Plan

Flow and swipe a message.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

angelika held this revision as a draft.

Thanks for finding this. Just wondering – did you find out because something was broken through testing, or because you observed that Flow was printing an error when the code looked right?

This revision is now accepted and ready to land.Wed, Dec 11, 5:02 PM

Thanks for finding this. Just wondering – did you find out because something was broken through testing, or because you observed that Flow was printing an error when the code looked right?

It went like this:

  • I used cancelAnimation without .value
  • Flow raised an error
  • I investigated it and found out the type was not right
  • Flow complained again in swipeable-message.react.js
  • I fixed it there and tested in the app to make sure nothing is broken

Rebase and address feedback