How's the _handleLoginCallback actually working? #154
bratelefant
started this conversation in
General
Replies: 2 comments 3 replies
-
I think we should use this topic to discuss how we want it to behave :-) I think we should definitely make this way more configurable (with decent zweo-config defaults):
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I think what needs to be refactored is definitely the token login flow, in any case. I'd consider this to be idempotent, but as far as I understand in the current implementation, a connection loss between sending the method call and getting the result in return will not be detected or handled/retried in any way. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm still trying to understand how all the log in, log out, disconnect, reconnect etc business is really working in different situations. @jankapunkt got an issue #151 and #148 first looked fine but especially on bad network conditions, after resuming my app (not using NetInfo, just rely on
AppState
events) I still get theMeteor.user()
to not be set.I looked across the
User.js
and came across the_handleLoginCallback
. Got a question here. Generally this method stores the resume-token in AsyncStorage and saves the userId.If there is an error and if the request is a "resume" request coming from a token, then this code is used:
Some questions and thoughts on this:
too-many-requests
errors?User._loginWithToken
ever called with a "not-nullish" value? Sinceif (User._userIdSaved) { return; }
only allows a second try with a "nullish" valueUser._loginWithToken(User._userIdSaved);
User._loginWithToken
be called with a token, rather than aUser._userIdSaved
?LocalCollections
companion package, setting AsyncStorage to SecureStorage would also push all Items inLocalCollections
as well; this doesn't seem a good solution, since obviously there's limits on available SecureStorage space (eg. Keychain, on iOS). Could be nice to provide a separate AsyncStorage interface for theLocalCollections
companion packageBeta Was this translation helpful? Give feedback.
All reactions