-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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 crash occurring when navigating to a new app screen with a displaying modal #45313
Conversation
Hi @zhouzh1! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Anyone can help take a look or provide some insights about if this change is safe or not? |
This issue is causing multiple crashes for us in production every day. Would appreciate if a fix like this could be merged. We use reset/replace actions when following deep links. No good way to know if the user has a modal open when we do so. Tested applying the suggested fix manually and it seems to work without issue. |
@mrand15 Glad to hear that it's working for you, I already applied this fix in our production app for a long while, seems that this issue has been resolved and this change didn't introduce other new issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that this is a fix for the old architecture only. Can I ask you to work also on the New Architecture?
The twin file should be this one: RCTModalHostViewComponentView.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I misclicked on 'Approve'.
We try not to accept fixes for the Old Architecture only. We would like at least to have the same fix in the New Arch or have a check that the New Arch does not suffer from the same issue.
@cipolleschi Sorry that our app hasn't started to apply the new React native architecture, so I am not sure if it's suffering from this issue as well, but I took a look at the above RCTModalHostViewComponentView file that you posted, I guess it's no problem, because in this file, the |
@cipolleschi Could you help take a look again? We're going to upgrade the react native in our project, if this fix makes sense, then we may don't need the extra patch file for react native. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing! Which version of React Native are you using?
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@cipolleschi merged this pull request in 52888c0. |
This pull request was successfully merged by Zhi Zhou in 52888c0 When will my fix make it into a release? | How to file a pick request? |
@zhouzh1 which version are you using? can you create a pick request for the versions that needs the fix? |
@cipolleschi - My project has upgraded to react-native:0.73.7 3 months back.I raised the issue #44612 . (void)dismissModalViewController |
yeah, 0.73 is still in the support window. |
@cipolleschi - Thanks for your update. |
@gkasireddy202 I don't know... I understood you were asking to pick the fix because you tested it and it fixed it... 😅 Can you try to:
|
@cipolleschi - I added that line to my project and tested it. I triggered the crash. |
…isplaying modal (#45313) Summary: Our app is using the react-native v0.74.2 with the `react-navigation` lib for screen navigation, we're facing an issue in the built iOS app that when we try to navigate to a new app screen with the `react-navigation`'s `reset` or `replace` method and meanwhile there's a react native modal displaying, then the iOS app always crashes. I saw there is already a relevant [PR](#38491) and discussion targeting this issue, but I still think it would be better if this kind of crash can be suppressed in the framework level, currently I guess it's common in the iOS apps based on react native. ## Changelog: [IOS] [FIXED] - app crash happening when navigate to a new app screen with a displaying modal Pull Request resolved: #45313 Test Plan: More issue details and the reproduction steps can be found in this [PR](#38491) :) Reviewed By: christophpurrer Differential Revision: D61537167 Pulled By: cipolleschi fbshipit-source-id: 3c0474d794b4216ebc073dd6558d2b6ae27492d2
This pull request was successfully merged by Zhi Zhou in 8ec6722. When will my fix make it into a release? | How to file a pick request? |
…isplaying modal (#45313) Summary: Our app is using the react-native v0.74.2 with the `react-navigation` lib for screen navigation, we're facing an issue in the built iOS app that when we try to navigate to a new app screen with the `react-navigation`'s `reset` or `replace` method and meanwhile there's a react native modal displaying, then the iOS app always crashes. I saw there is already a relevant [PR](#38491) and discussion targeting this issue, but I still think it would be better if this kind of crash can be suppressed in the framework level, currently I guess it's common in the iOS apps based on react native. ## Changelog: [IOS] [FIXED] - app crash happening when navigate to a new app screen with a displaying modal Pull Request resolved: #45313 Test Plan: More issue details and the reproduction steps can be found in this [PR](#38491) :) Reviewed By: christophpurrer Differential Revision: D61537167 Pulled By: cipolleschi fbshipit-source-id: 3c0474d794b4216ebc073dd6558d2b6ae27492d2
…isplaying modal (#45313) Summary: Our app is using the react-native v0.74.2 with the `react-navigation` lib for screen navigation, we're facing an issue in the built iOS app that when we try to navigate to a new app screen with the `react-navigation`'s `reset` or `replace` method and meanwhile there's a react native modal displaying, then the iOS app always crashes. I saw there is already a relevant [PR](#38491) and discussion targeting this issue, but I still think it would be better if this kind of crash can be suppressed in the framework level, currently I guess it's common in the iOS apps based on react native. ## Changelog: [IOS] [FIXED] - app crash happening when navigate to a new app screen with a displaying modal Pull Request resolved: #45313 Test Plan: More issue details and the reproduction steps can be found in this [PR](#38491) :) Reviewed By: christophpurrer Differential Revision: D61537167 Pulled By: cipolleschi fbshipit-source-id: 3c0474d794b4216ebc073dd6558d2b6ae27492d2
Summary:
Our app is using the react-native v0.74.2 with the
react-navigation
lib for screen navigation, we're facing an issue in the built iOS app that when we try to navigate to a new app screen with thereact-navigation
'sreset
orreplace
method and meanwhile there's a react native modal displaying, then the iOS app always crashes.I saw there is already a relevant PR and discussion targeting this issue, but I still think it would be better if this kind of crash can be suppressed in the framework level, currently I guess it's common in the iOS apps based on react native.
Changelog:
[IOS] [FIXED] - app crash happening when navigate to a new app screen with a displaying modal
Test Plan:
More issue details and the reproduction steps can be found in this PR :)