Thank you for the detailed response and example. However, I've noticed an unexpected behavior in the implementation.
The expected behavior of this code looks like "normal output" from this file: https://github.com/teameh/GestureIssueTester/blob/engineer-example/output.txt
This shows the expected flow: state changes during gesture updates, followed by gesture completion and state reset.
But if you try this example out, and mess a bit with the gestures, within a minute, the console will look like this and everything will get stuck.
See "error ouput" in this file: https://github.com/teameh/GestureIssueTester/blob/engineer-example/output.txt
Two key issues are apparent:
The state no longer resets to initial values
The onEnded handler stops being called
I've recorded this happening in this video. https://github.com/teameh/GestureIssueTester/raw/refs/heads/engineer-example/screen-recording-engineer-example.mov
I'm just activating the gestures and letting them end a couple of times. In the video, after 3 seconds everything gets stuck and nothing is printed any more, even when you keep trying to activate the gesture.