react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Scroll events randomly stop working in development

Open gaearon opened this issue 2 years ago • 6 comments

Description

This has been happening for many weeks so we got used to it but I figured I'd file an issue in case it isn't known.

Renimated events like useAnimatedScrollHandler sometimes just stop working in the simulator. It definitely happens on iOS but I'm pretty sure I've seen it happen on Android. I don't believe it happens on the web.

A reliable way to get them "unstuck" is to save a file inside react-native-reanimated. I'm not sure whether it matters which file to save. I usually have WorkletEventHandler.ts open at all times because I save it many times per day to trigger whatever the thing that gets it unstuck. I can check later whether saving other files also helps.

Steps to reproduce

I don't have an exact consistent repro, but it does happen literally every day.

So I bet if you screw around with https://github.com/bluesky-social/social-app you'll eventually run into it too.

Snack or a link to a repository

https://github.com/bluesky-social/social-app

Reanimated version

3.4.2

React Native version

0.72.5

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

None

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

gaearon avatar Nov 10 '23 00:11 gaearon

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Nov 10 '23 00:11 github-actions[bot]

@gaearon believe this is related to issues with the simulator I found e.g. that simulator doesn't return velocity readings in a PanGesture https://stackoverflow.com/questions/70390265/uipangesturerecognizer-velocity-return-0-in-simulator-macbook-m1

henrymoulton avatar Nov 28 '23 13:11 henrymoulton

Why does saving a file inside node_modules always fix it?

gaearon avatar Dec 11 '23 20:12 gaearon

Hi @gaearon, just to be curious - does this happen when you attach the same handler to multiple components? If yes, then my comment applies here as well.

tjzel avatar Dec 17 '23 15:12 tjzel

This doesn't seem related to me — I think I started seeing this before we started passing events to multiple handlers (and it's still happening after we stopped doing that).

gaearon avatar Dec 18 '23 17:12 gaearon

@gaearon I messaged you in Discord because I have some trouble building Bluesky to test it.

tjzel avatar Dec 18 '23 20:12 tjzel

This seems like it hasn't happened for a long while fwiw.

gaearon avatar May 28 '24 22:05 gaearon