You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Global _signinPromise Promise means that you can never call multiple methods at the same time. I think you want to use a final variable that's a wrapper around the Promise variable that you can then use inside the callbacks. This can happen for example if two parts of the code call currentUserAsync() at the same time. Only one will get a reply.
Note that you must not resolve promises more than once even though that's fine in JS since RN's Java Promise is implemented wrong: facebook/react-native#20262
and use that resolver inside the Runnable on the UI thread. signIn() is the only one with an activityResult where you need to use a global. For that I'd suggest rejecting if a duplicate request comes in so no one is ever left hanging. So at the top of signIn() you'd have:
if (_signInResolver) {
promise.reject(MODULE_NAME, "Already doing signin.")
return;
}
Thanks for reporting! We've addressed this problem in #459. It's on master now but all those changes are not properly documented, yet. This will be included in to the next release!
Global
_signinPromise
Promise means that you can never call multiple methods at the same time. I think you want to use a final variable that's a wrapper around the Promise variable that you can then use inside the callbacks. This can happen for example if two parts of the code callcurrentUserAsync()
at the same time. Only one will get a reply.Note that you must not resolve promises more than once even though that's fine in JS since RN's Java Promise is implemented wrong: facebook/react-native#20262
Something like:
and then inside each method like
configure(ReadableMap config, Promise promise)
orsignOut(Promise promise)
you'd do:and use that resolver inside the Runnable on the UI thread.
signIn()
is the only one with an activityResult where you need to use a global. For that I'd suggest rejecting if a duplicate request comes in so no one is ever left hanging. So at the top ofsignIn()
you'd have:Steps to Reproduce
It'll only log once the 2 because the global _signinPromise is overridden.
Expected Behavior
Can make multiple calls to methods like
currentUserAsync()
at the same time.Actual Behavior
Only the last method call on the entire module ever gets a response.
Environment
n/a.
The text was updated successfully, but these errors were encountered: