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
chore(AWSMobileClient): Add validation for the initial state of AWSMobileClient #4547
Conversation
75ba729
to
1c5e568
Compare
1c5e568
to
b0fbdc5
Compare
AWSAuthSDK/AWSAuthSDK.xcodeproj/xcshareddata/xcschemes/AWSMobileClient.xcscheme
Outdated
Show resolved
Hide resolved
// UserPoolOperationHandler should be initialized after AWSMobileClient init and AWSInfo init is | ||
// completed, because it require the AWSInfo to be in a valid state to initialize. To acheive this | ||
// currently userpoolOpsHelper is initialized inside `_internalInitialize`. | ||
internal var userpoolOpsHelper: UserPoolOperationsHandler! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a note here that this should be accessed synchronously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what you meant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think UserpoolOpsHelper needs to be accessed in a synchronized way, like in a initializationqueue.sync
block - i thought it'd be good idea to note it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, that sync block is for intializing AWSMC, but UserPoolOpsHelper by itself can be accessed from an async context as well.
AWSAuthSDK/Tests/AWSMobileClientUnitTestWithApp/Helpers/AWSMobileClientHelper.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor changes
Issue #, if available:
Description of changes: Add validation while initializing AWSMobileClient, this PR will make sure that the user is has valid data from keychain before moving them to a signedIn state during initialization.
Check points:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.