-
Notifications
You must be signed in to change notification settings - Fork 585
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
Realm.login() will not run again after refreshing React Native app #3236
Comments
I have the same issue. |
➤ Chris Bush commented: Encountered this myself. Some investigation revealed that (on iOS at least) the RunLoopScheduler is stale because its m_runloop is still pointing to the original thread, whereas the JS executor is actually running on a different thread after an app reload. This causes the scheduler to never be able to schedule requests, so the requests to log in are never heard from again. Please DM me for more details. |
this is fixed in #3340 |
The problem with the fix in #3340 was that it was causing the EventLoopDispatcher to be constructed on the sync thread rather than on the JS thread, which is required. This alternative fix initializes it on the JS thread, but ensures it is re-initialized when RN apps are reloaded.
* Revert "recreate EventLoopDispatcher in NetworkTransport on hot reload in RN (#3340)" This reverts commit 4c4e497. * Alternative fix for #3236 that avoids causing #3503 The problem with the fix in #3340 was that it was causing the EventLoopDispatcher to be constructed on the sync thread rather than on the JS thread, which is required. This alternative fix initializes it on the JS thread, but ensures it is re-initialized when RN apps are reloaded. Co-authored-by: Kenneth Geisshirt <[email protected]>
Goals
Be able to successfully call
Realm.login()
again after refreshing app.Expected Results
Login should run and return the user information like the first time the app loads
Actual Results
Nothing happens, no errors shown in the console. Realm logs don't show the request is being made.
When I fire up the React Native Debugger, I did see an error about
Realm.Credentials.function(payload);
not being able to be created. I believe some of the functionality for function auth is missing in thelib/browser/credentials.js
andlib/browser/rpc.js
. We are using function auth, however, I received the same behavior of the original issue using anonymous and other auth types.Steps to Reproduce
Launch app from Xcode in simulator or on iOS device.
Run Login (works beautifully).
Refresh the react native bundle from the package server.
Try to login again (nothing happens)
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: