react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

fix a potential race on component unmount

Open phryneas opened this issue 3 years ago • 0 comments

Description

This fixes a potential race condition where the component unmounted before the callback passed into setImmediate in updateHandlers could execute.

That would lead to a "No handler for tag X" error, since the handler would not have been registered any more at that point in time.

There might also be other race conditions because of that setImmediate, but this is the only one I could reproduce.

Test plan

I encountered this in our project code and debugged it with a replay recording. I might be able to provide that replay if contacted on a private side channel for verification purposes, but I assume the problem & solution are probably already understandable just by the explanation above.

phryneas avatar Oct 07 '22 11:10 phryneas