Skip to content

fix(ios): app stopped responding after screen rotation - #9986

Merged
NathanWalker merged 1 commit into
NativeScript:mainfrom
CatchABus:ios-rotation-infinite-loop-fix
Aug 8, 2022
Merged

NathanWalker merged 1 commit into
NativeScript:mainfrom
CatchABus:ios-rotation-infinite-loop-fix

Conversation

@CatchABus

@CatchABus CatchABus commented Aug 5, 2022 •

Copy link
Copy Markdown
Contributor

PR Checklist

What is the current behavior?

The iOS app isn't responding after rotation. The issue is only reproducible on the iOS phone. Cannot be reproduced on an iOS tablet.

The issue can be reproduced immediately (after the first rotation) on the nested tabs scenario.

See #9931 for more details by @dgmachado. He has provided a sample and precious information.

If needed, NS view controllers will modify their own insets when they layout subviews. This seemed to cause problems in a rotation scenario due to wrong checks inside core during children insets calculation.

What is the new behavior?

Application will operate normally after rotation without problems.

Fixes #9931

@cla-bot cla-bot Bot added the cla: yes label Aug 5, 2022
@dgmachado

Copy link
Copy Markdown
Contributor

I've tested this solution in different apps using iOS simulators: iphone 8, 12 and 13 and it's working properly. I did a lot of stress test and could not reproduce the issue again.

@NathanWalker
NathanWalker merged commit 946dd34 into NativeScript:main Aug 8, 2022
@NathanWalker

Copy link
Copy Markdown
Contributor

@CatchABus this appears to cause quite a number of failed e2e tests:
https://github.com/NativeScript/NativeScript/runs/7728405092?check_suite_focus=true
For example:

Test: SAFEAREALAYOUT.test_absolute_in_full_screen_action_bar FAILED: AbsoluteLayout<abs>.top - actual:273; expected: 0 Actual: <273>(number). Expected: <0>(number)
  Test: SAFEAREALAYOUT.test_absolute_in_full_screen_action_bar_hidden FAILED: AbsoluteLayout<abs>.top - actual:141; expected: 0 Actual: <141>(number). Expected: <0>(number)
  Test: SAFEAREALAYOUT.test_absolute_in_full_screen_action_bar_flat FAILED: AbsoluteLayout<abs>.top - actual:273; expected: 0 Actual: <273>(number). Expected: <0>(number)
  Test: SAFEAREALAYOUT.test_absolute_in_full_screen_tab_bar FAILED: AbsoluteLayout<abs>.top - actual:141; expected: 0 Actual: <141>(number). Expected: <0>(number)

@NathanWalker

Copy link
Copy Markdown
Contributor

You can run them locally with: npx nx run apps-automated:ios

@CatchABus

Copy link
Copy Markdown
Contributor Author

@CatchABus this appears to cause quite a number of failed e2e tests: https://github.com/NativeScript/NativeScript/runs/7728405092?check_suite_focus=true For example:

Test: SAFEAREALAYOUT.test_absolute_in_full_screen_action_bar FAILED: AbsoluteLayout<abs>.top - actual:273; expected: 0 Actual: <273>(number). Expected: <0>(number)
  Test: SAFEAREALAYOUT.test_absolute_in_full_screen_action_bar_hidden FAILED: AbsoluteLayout<abs>.top - actual:141; expected: 0 Actual: <141>(number). Expected: <0>(number)
  Test: SAFEAREALAYOUT.test_absolute_in_full_screen_action_bar_flat FAILED: AbsoluteLayout<abs>.top - actual:273; expected: 0 Actual: <273>(number). Expected: <0>(number)
  Test: SAFEAREALAYOUT.test_absolute_in_full_screen_tab_bar FAILED: AbsoluteLayout<abs>.top - actual:141; expected: 0 Actual: <141>(number). Expected: <0>(number)

My bad... I'll make sure to look into this as soon as possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants