Skip to content

[Android] Guard update events to only be dispatched in ACTIVE state#4332

Merged
j-piasecki merged 1 commit into
mainfrom
android-update-only-in-active
Jul 23, 2026
Merged

[Android] Guard update events to only be dispatched in ACTIVE state#4332
j-piasecki merged 1 commit into
mainfrom
android-update-only-in-active

Conversation

@j-piasecki

Copy link
Copy Markdown
Member

Description

  1. Removes unused isFirstEvent
  2. Adds a guard to ensure update events are only dispatched in ACTIVE state. I've noticed that dispatchHandlerUpdate was being called in state END.

Test plan

I didn't observe it in the runtime, only in the debugger while working on Touchable optimizations.

Copilot AI review requested due to automatic review settings July 23, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines Android gesture update dispatching in the core GestureHandlerOrchestrator by removing dead local state and preventing unnecessary update dispatch attempts after a handler has already transitioned out of ACTIVE.

Changes:

  • Removes an unused local variable (isFirstEvent) in event delivery.
  • Adds an explicit state check so dispatchHandlerUpdate is only invoked when the handler’s state is STATE_ACTIVE (in addition to the existing isActive guard).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@j-piasecki
j-piasecki merged commit 0bbd40f into main Jul 23, 2026
4 checks passed
@j-piasecki
j-piasecki deleted the android-update-only-in-active branch July 23, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants