Commit b9c7af0
authored
Fix: race condition on attachedGestures in updateHandlers (#3425)
## Description
Our production apps are regularly crashing with the following
stacktracke:
```
Non-fatal Exception: io.invertase.firebase.crashlytics.JavaScriptError: Cannot read property 'handlers' of undefined
at .anonymous(address at node_modules/react-native-gesture-handler/src/handlers/gestures/GestureDetector/updateHandlers.ts:51:ghQueueMicrotask$argument_0)
at .anonymous(address at node_modules/react-native/Libraries/Core/Timers/immediateShim.js:46:global.queueMicrotask$argument_0)
```
This seems to be caused by a race condition on the number of gestures in
`preparedGesture.attachedGestures`. This PR fixes that race condition by
storing the value of `preparedGesture.attachedGestures` from when the
micro task was scheduled.
## Test plan
Run example apps1 parent b760f8e commit b9c7af0
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | | - | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
73 | | - | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
0 commit comments