Skip to content

[General] Fix relations not being applied in api V1#4207

Merged
j-piasecki merged 1 commit into
mainfrom
@jpiasecki/fix-relations-v1
May 28, 2026
Merged

[General] Fix relations not being applied in api V1#4207
j-piasecki merged 1 commit into
mainfrom
@jpiasecki/fix-relations-v1

Conversation

@j-piasecki
Copy link
Copy Markdown
Member

Description

  1. configureRelations wasn't called after creating the gesture, only after the update.
  2. filterConfig isn't idempotent, and calling it a second time resulted in the relations arrays being cleared. Adds a simple selectProperties util to use instead.

Test plan

Test legacy Multitap example

Copilot AI review requested due to automatic review settings May 27, 2026 17:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes legacy (API v1) gesture-handler “relations” (e.g. waitFor, simultaneousHandlers, blocksHandlers) not being applied on initial handler creation, and prevents relations from being accidentally cleared by re-filtering already-filtered config.

Changes:

  • Call RNGestureHandlerModule.configureRelations immediately after createGestureHandler so relations are applied on first mount.
  • Stop using filterConfig to re-filter relation props during updates; use a new selectProperties helper to pick relation fields without re-transforming them.
  • Add selectProperties utility to handlers/utils.ts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/react-native-gesture-handler/src/handlers/utils.ts Adds selectProperties helper intended to avoid non-idempotent filterConfig behavior for relations.
packages/react-native-gesture-handler/src/handlers/createHandler.tsx Applies relations on creation and switches update-time relation extraction to selectProperties.

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

Comment thread packages/react-native-gesture-handler/src/handlers/utils.ts
Comment thread packages/react-native-gesture-handler/src/handlers/utils.ts
Copy link
Copy Markdown
Collaborator

@m-bert m-bert left a comment

Choose a reason for hiding this comment

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

filterConfig isn't idempotent

And I think it should be, right? Anyway, that's probably not for now. Leaving ✅ so it is not blocked before release.

Also, do you know why Android worked anyway?

@j-piasecki
Copy link
Copy Markdown
Member Author

And I think it should be, right?

It wouldn't hurt, but I don't know if something relies on it at this point.

Also, do you know why Android worked anyway?

No 😞

@j-piasecki j-piasecki merged commit 7bed7dd into main May 28, 2026
3 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/fix-relations-v1 branch May 28, 2026 05:13
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