Skip to content
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

Merged
merged 9 commits into from Feb 24, 2023

Conversation

royjit
Copy link
Member

@royjit royjit commented Feb 7, 2023

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:

  • Added new tests to cover change, if needed
  • All unit tests pass
  • All integration tests pass
  • Updated CHANGELOG.md
  • Documentation update for the change if required
  • PR title conforms to conventional commit style

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@royjit royjit marked this pull request as ready for review February 8, 2023 23:14
@royjit royjit requested review from a team and awsmobilesdk as code owners February 8, 2023 23:14
@royjit royjit changed the title chore(AWSMobileClient): Format the initialize function chore(AWSMobileClient): Add validation for the initial state of AWSMobileClient Feb 8, 2023
AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClient.swift Outdated Show resolved Hide resolved
AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClient.swift Outdated Show resolved Hide resolved
AWSAuthSDK/Sources/AWSMobileClient/AWSMobileClient.swift 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!
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

@thisisabhash thisisabhash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor changes

@royjit royjit merged commit 66bba58 into main Feb 24, 2023
@royjit royjit deleted the royjit.formatawsmc branch February 24, 2023 22:24
gabek pushed a commit to KeepSafe/aws-sdk-ios that referenced this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants