-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
React Native 0.61.1 and iOS 13.1.2 leads to lots of unneeded relaunches of our app #26696
Comments
Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety? 👉 Click here if you want to take another look at the Bug Report issue template. |
Are you sure your app is not crashing in the background? Do you have any crash reporting service enabled? |
@radko93 Pretty sure it's not crashing. I've narrowed it down to a commit that was responsible for the 0.61 upgrade -- before that commit doesn't matter how long you put the app in the background (say 10 minutes) it's still active when you come back. We've noticed as little as 1 minute timed of launching the app going over to Instagram and doing literally nothing for a minute then back to our app, relaunch. We have no background processes for this app. And while we don't have a ton of devices to test on at the moment we have only noticed it on the latest iOS. |
@bobber205 @radko93 Have almost same issue Just app is really crashing on iOS 13.1.2 when device is sleeping or app just staying in background |
Are you using Websockets @bobber205 @oleksandr-dziuban ? |
No, I don't use Websockets. For data transport I use GraphQL based on Apollo Client without Websockets. "@react-native-community/async-storage": "1.6.2",
"@react-native-community/netinfo": "4.2.2",
"react-native": "0.61.2",
"react-native-dynamic-fonts": "0.3.1",
"react-native-image-crop-picker": "0.25.2",
"react-native-keyboard-aware-scroll-view": "0.9.1",
"react-native-popup-menu": "0.15.6",
"react-native-render-html": "4.1.2",
"react-native-restart": "0.0.13",
"react-native-router-flux": "4.0.6",
"react-native-share": "2.0.0",
"react-native-sqlite-storage": "4.1.0",
"react-native-svg": "9.9.5",
"react-native-version-number": "0.3.6",
"react-native-view-shot": "3.0.2",
"react-native-webview": "7.2.7",
"react-native-woodpicker": "0.0.17",
"rn-fetch-blob": "0.11.2", There are no background processes in the app. |
@radko93 Just interesting, I have found how to reproduce that even on iOS 13.0 Simulator with Xcode 11.0
Veeery tricky issue.... |
@radko93 Yes, very easy to reproduce even on newest iOS 13.1 Simulator (Xcode 11.1) Also reproduced on iOS 13.1 Simulator iPhone 11 (Xcode 11.1):
For best crash detection I use react-native-debugger with Memory Tab: when application will be crashed - we will see that in |
@oleksandr-dziuban it's complicated because I cannot reproduce it for now with my app on RN 0.61.2. |
Did you wait 1-2 minutes in sleep mode on simulator? |
Maybe this is native libraries specific issue? Some library is crashing in sleep mode, maybe react-native-webview, maybe netinfo.... Tricky case.... |
@oleksandr-dziuban I wait 10 or more minutes on iPhone 6s with latest iOS (Release build). Might be netinfo, try to comment it out. Try to comment out different things and see if it helps. |
I'm using Apollo Client for GraphQL data transport, it can use Websockets under the hood for GraphQL subscriptions Maybe this causing crash Additionally I will comment all Native packages one by one to check |
Disabled NetInfo, WebView - nothing changed |
@radko93 I have reproduced this even on fresh react-native app without any additional code! Steps:
|
This is the same issue that I am seeing, but I am on |
i don't use Websockets either. |
@SYoder1 Good to know! I think that means this is a React Native + newest version of iOS issue not specific to a version of react (seems that way anyway) |
@bobber205 I am also not using Websockets |
@bobber205 Yes, I think in iOS 13 we have new mechanism for sleep/awake in apps and something went wrong now with react-native apps. |
@oleksandr-dziuban I tried but my app did not crash. Background Modes is enabled and these are selected |
I will try to do the same |
@Farad4y @bobber205 I have added this capabilities. |
@oleksandr-dziuban That's exactly what we're seeing. |
@minhtc thanks for investigating, this might be the commit that is causing this issue 3382984#diff-29f34a4d1c9b73a44351941dae6056c8 |
Anyway known way (hard or easy) to disable that functionality for consumers who don't need it? 🙏 |
I submitted a PR to fix that for 0.61.x, You can upvote it there #27065 . If it gets merged then it will be available in 0.61.4. |
Summary: Related #23674, in that PR, we imported background timer support, but it's not sufficient, I think the reason that works is because it enable the `Background Modes` and do some background tasks, for the users who don't enable it, timer would pause immediately before goes into background. To fix it, we can mark a background task when goes into background, it can keep app active for minutes, try best to support timing when in background. cc. cpojer . ## Changelog [iOS] [Fixed] - Timing: Fixes timer when app get into background Pull Request resolved: #24649 Differential Revision: D15554451 Pulled By: cpojer fbshipit-source-id: a33f7afe6b63d1a4fefcb7098459aee0c09145da
Hi, anyone can try new a project(not include RN), just begin a background task to see wether it terminated by system? code like 3382984#diff-29f34a4d1c9b73a44351941dae6056c8R150-R157. |
I reviewed the timer module again, I may suspect there have thread-safe issue, @bobber205 @oleksandr-dziuban can you guys can help to dig in? Replace 3 methods in RCTTiming.m like https://github.com/facebook/react-native/pull/25164/files#diff-29f34a4d1c9b73a44351941dae6056c8R174-R202, and try wether it crashed on iOS 13.1. Thanks. |
I can try next week
…On Fri, Nov 1, 2019, 8:46 PM Wu Zhong ***@***.***> wrote:
I reviewed the timer module again, I may suspect there have thread-safe
issue, @bobber205 <https://github.com/bobber205> @oleksandr-dziuban
<https://github.com/oleksandr-dziuban> can you guys can help to dig in?
Replace 3 methods in RCTTiming.m like
https://github.com/facebook/react-native/pull/25164/files#diff-29f34a4d1c9b73a44351941dae6056c8R174-R202,
and try wether it crashed on iOS 13.1. Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#26696?email_source=notifications&email_token=ABMSBU74VOQGEJALVOSHKYDQRTZZLA5CNFSM4I44TOJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC4S52A#issuecomment-549007080>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMSBU3CEMWRTSY3TS6BAOTQRTZZLANCNFSM4I44TOJQ>
.
|
You can now try 0.61.4 as it includes a fix. |
…27073) Summary: This PR reverts commit 3382984 that is causing #26696 #26995. > app would be closed immediately after going to background on iOS 13.1/13.2 and was investigated by minhtc #26696 (comment). The commit that is being reverted is apparently causing the app to be closed immediately. This has to be reverted in master separately as the file differs there. Similar PR for 0.61. branch #27065 ## Changelog [iOS] [Fixed] - Fix apps crashing on iOS 13.x when running timer in the background Pull Request resolved: #27073 Test Plan: Try [this](3382984#commitcomment-35745287) snippet on iOS 13.1/13.2, the app should not crash anymore Differential Revision: D18323679 Pulled By: cpojer fbshipit-source-id: 3af7036a0e1d3811924e581c649b16e5a4667e83
This is now fixed on 61 branch and on master. |
Still having same issue. Works fine on simulators as well devices upto iPhone 8. For devices of X series, crash is happening still after 2-3 minutes |
any other ideas what could cause this? Upgrading to .61.5 didn't fix this for me :/ |
@sarthak216-blr , @octodhruv are you guys using Websockets? |
@vforvasile Nope - no websockets. |
1- app closed (not in background)
can anyone help? |
This is causing serious issues for us as well @radko93 |
@vforvasile @radko93 Hi. I'm curious why you asked if we are using Websockets. Could you provide more details on how would that cause the problem? |
I have exactly the same issue and currently fix it with RN 0.61.5, but when using 0.61.4 sometimes unstable. |
Last week we upgraded to the latest version of React. Around the same time my boss updated his phone to iOS 13.1.2 (got a new phone)
I have a iPhone 5S on my desk with iOS 12.x (whatever the latest in that branch is I updated it today)
I also run the app on my Android 10 phone.
After almost no time at all with the app not focused my boss's phone relaunches the app as if the phone just rebooted. Splash screen and everything. This doesn't happen on the very old iPhone 5. Not on Android either. Of course this relaunch can happen under certain circumstances that are reasonable. For instance my boss will open our app, open up IG and TW, then go back to our app and it relaunches.
We narrowed it down to our upgrade of .60.x to 0.61.1 last Thursday.
This is a very jarring UX issue. I'm not sure how to produce a reproducible use case since it depends on the latest version of iOS and I'm really busy trying to fix other bugs atm related to the new version of iOS. Has anyone else experienced this?
The text was updated successfully, but these errors were encountered: