Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iOS, Paper): possibility of infinite loop when swiping back in nested stack #2223

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

kkafar
Copy link
Member

@kkafar kkafar commented Jul 2, 2024

Description

In #2193 I've made a mistake - on Paper, when there is no touch handler held in _touchHandler field I've started
lookup for touch handler in ancestor chain from self -> which leads to infinite loop when swiping back in nested-stack navigation scenario.

Changes

  • Started lookup from superview.

Test code and steps to reproduce

Test2223

  1. Navigate to NestedStack.
  2. Navigate to NestedStack details screen.
  3. Use swipe gesture to go-back

W/o this PR the application will crash hitting infinite loop.

Also test that this behaviour remains fixed:

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@kkafar kkafar requested review from alduzy, maciekstosio and tboba July 2, 2024 11:32
@kkafar kkafar merged commit e53dcb9 into main Jul 2, 2024
5 checks passed
@kkafar kkafar deleted the @kkafar/infinite-loop-ios branch July 2, 2024 13:39
ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this pull request Oct 9, 2024
…sted stack (software-mansion#2223)

## Description

In software-mansion#2193 I've made a mistake - on Paper, when there is no touch handler
held in `_touchHandler` field I've started
lookup for touch handler in ancestor chain from `self` -> which leads to
infinite loop when swiping back in nested-stack navigation scenario.


## Changes

* Started lookup from superview.


## Test code and steps to reproduce

`Test2223`

1. Navigate to NestedStack.
2. Navigate to NestedStack details screen.
3. Use swipe gesture to go-back


W/o this PR the application will crash hitting infinite loop.

Also test that this behaviour remains fixed:

* software-mansion#2131

## Checklist

- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes
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