-
Notifications
You must be signed in to change notification settings - Fork 586
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 app freezes on Android devices after some time of inactivity #3984
Comments
The fix for #3668 was released in version 10.4.2, and I suggest that you upgrade from version 10.1.2 to latest version. However, I am curious to know long time time "some time of inactivity" is? |
Thanks @kneth, the issue on Android was occurring randomly. I'd say after about 30 mins of inactivity or so? Sometimes it would be fine, sometimes it would freeze and I'd have to do the Clear App Data hack (which means losing all unsynced data). Following your advice, I've upgraded to Realm 10.8.0 but I'm now getting a sync error I guess it's a different issue from that initially raised here but because of this constant crashing, I can't tell whether my initial freezing issue is resolved or not. In Metro, double pressing the R key still leads to freezing so my guess is that it is not resolved yet? Regarding this new |
30 minutes sound like the access token hasn't been refreshed correctly. It might help to call
|
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
How frequently does the bug occur?
All the time
Description
Opening the app on an Android device after some time of inactivity should not freeze. Instead users should be able to return to where they left off.
Stacktrace & log output
No response
Can you reproduce the bug?
Yes, always
Reproduction Steps
We have a React Native application using Realm Sync to sync three realms (user, company and site). When running on real Android devices, if the app is left inactive for a certain amount of time, the app freezes on their latest screen (I can scroll up and down but cannot press any buttons). This issue can be replicated in Android simulators by double pressing the R key in Metro.
On real devices, closing the app and reopening does not fix the issue. The only 'fix' I’ve found is to go in App Settings and clear app data. This logs the user out and they have to log back in before using the app again (and all unsynced progress is lost).
The thing that is strange is that the data from all three realms is read correctly before the freeze happens, so it’s not like the
Realm.open()
is hanging (the.then()
part of the code is read fine so I imagine the promise has been fulfilled?).The issue does not occur on iOS devices. I’ve read on #3668 that Android handles cache clearing in a different way from iOS and that it could be the cause behind the problem.
This is how I open my three realms (example of user realm here):
`
let realm = await Realm.open(config).then((userRealm) => {
realmRef.current = userRealm;
const users = userRealm.objects("user");
// Do stuff with users here
}
The text was updated successfully, but these errors were encountered: