-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Authentication not consistently persisting between sessions #980
Comments
Actually, this seems to be affecting closer to 40% of our users, who have to re-login every time. This is a very UX-breaking issue that we're not sure how to deal with. |
Can I ask why you're doing this part?
When you say an error appears - how are you presenting this to your user? Beyond that, I'm really not to sure what to suggest - ultimately Having a look at the code, there is currently the tiniest point of time where the user might incorrectly be reported as null: https://github.com/invertase/react-native-firebase/blob/master/lib/modules/auth/index.js#L106 You'll notice that we set I can certainly fix this, or you could manually change the file in your build to move the user creation before the setting of the I'm assuming you haven't been able to reproduce locally at all? |
We call
If there is ever an explicit error with authentication, we log the user out, send them to the login screen, and display an error message. This mostly applies to edge cases where the authentication may expire or be otherwise invalidated mid-session. However, in this case the user is sent to the login screen without any error message after having authenticated in a recent session. When the app boots, we subscribe to
When this happens, the
I have not been able to reproduce this myself yet. I'm only going off of reports from our users. It seems to consistently affect a select number of users. In other words, only X% of devices/users are affected, rather than X% of sessions. |
I'll have a chat with @Salakar and talk through this change to confirm it won't affect anything else then try and get a release out. Is there any pattern to the type of devices that are experiencing this issue? Are they newer, faster devices? Or older, slower devices? Or is it just random? Seems odd that it's the same users/devices that are seeing the issue rather than just a percentage of sessions unless there is some correlation in the performance of the devices... |
I've just published v4.0.6 which has this possible fix in - it would be great if you're able to roll this out and see whether it addresses your issues? |
Sounds good. We're shipping a new version in the next 36 hours, we'll update to 4.0.6 and see what happens. |
Perfect, let us know. |
@wbattel4607 Have you had a chance to get this released and tested? |
We've released it and are monitoring for any changes in behavior. I'll let you know what we find. |
Perfect, thanks. Fingers crossed! |
@wbattel4607 How's this looking? |
We've been getting fewer reports, although I am hesitant to say it's resolved yet. If you would like to close the issue, go ahead. If we should discover the problem persists we can create a new issue and reference this one. |
Will do, thanks. |
@chrisbianca can I ask what was the issue here? I'm encountering a similar issue with Firebase Auth in an Angular project and am having trouble narrowing it down. |
currently have the same issue in my application. i use firestore listeners to stream data into the application but after being left in the background for lets say 2 hours or more and going back to the application the app no longer recieves data from firestore. User has to log out and login back with firebase auth to get it working again. which indicates to me that its an auth issue |
Any updates on this? |
@ankitbishtapollo this issue was opened in 2018, and closed in 2018. Why would there be any updates on a 2 year stale issue? If you have problems with current stable versions please open a new issue and respect the template, then people can try to help |
Ok @mikehardy will raise a new ticket. You can close this |
Issue
Some of our users (about 20% at this point) are losing their authentication between sessions. This includes terminating the app, or simply leaving it in the background for a while. The effected users have to re-login every session. For those 20% it is happening very frequently.
We offer both Facebook and Phone authentication. The problem is not discriminating between providers- both are experiencing this.
This is the onAuthStateChanged subscription code in our root component.
This is the logout method. If the parameter passed is
false
, an error message appears. The users getting logged out are not getting the error message. We have confirmed that the error message is functioning properly for other cases. This means that the logout() function isn't being called.It is possible that this is related to #962. There seems to be a correlation between the users affected by both issues, but it is not a 100% match by any means.
Environment
Any ideas? Thanks!
The text was updated successfully, but these errors were encountered: