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

Quickfix: Run Realm.App._clearAppCache() on load. #3755

Closed
wants to merge 2 commits into from

Conversation

steffenagger
Copy link
Contributor

This PR executes Realm.App._clearAppCache() on load, to re-matchup C++ & JS environments for RN hot-reloading.

This closes #3668

@kraenhansen
Copy link
Member

kraenhansen commented May 27, 2021

I don't know if this is a huge problem, but it seems we're already clearing this cache natively on iOS from react-native/ios/RealmReact/RealmReact.mm#L267 (which calls src/jsc/jsc_init.cpp#L57-L62).

To avoid calling it twice, we might either want to remove it from the native code entirely or add it to the Android native code instead of calling it from JS.

@kneth
Copy link
Contributor

kneth commented May 27, 2021

It might be safer to do it when you load Realm, but I agree with @kraenhansen that we shouldn't do it twice.

@kraenhansen
Copy link
Member

Okay. I realize now that we're clearing other caches when running on Android here: https://github.com/realm/realm-js/blob/master/src/android/jsc_override.cpp#L137 - we should probably just add the realm::app::App::clear_cached_apps(); after that line.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App login function freezes/hangs when React-Native environment is reloaded (press R twice) on Android
3 participants