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

Delay on AWSMobileClient initialize method #5422

Closed
lendk-dua opened this issue Aug 9, 2024 · 2 comments
Closed

Delay on AWSMobileClient initialize method #5422

lendk-dua opened this issue Aug 9, 2024 · 2 comments
Labels
bug Something isn't working mobile client Issues related to AWSMobileClient

Comments

@lendk-dua
Copy link

Describe the bug
We have recently updated our SDK to the latest version 2.36.3. We noticed that the initialize method is causing significant hanging on our app. This is significant for us as it is part of our logic in which we check if the user is logged in or not - in which we redirect the user either on our welcome screen or our main home screen. Note that the previous used version was a older version of this sdk 2.17.0. We have also tried to check this user state via currentUserState but the sdk must initialize before we can access this value. Similiar to this we also encounter speed changes to AWSMobileClient getTokens method.

To Reproduce
Steps to reproduce the behavior:

  • Update SDK Version from 2.17.0 to 2.36.3
  • Initialize mobileClient on didFinishLaunching(with options)

Observed Behavior

  • There is a 4-5 sec delay when the app is launched

Expected Behavior

  • The app should launch as soon as the LaunchScreen is dismissed

Code Snippet

let mobileClient = AWSMobileClient(configuration: APIConstants.AWSCredentials.mobileClientEndpoint)

func initializeUser(completion: @escaping GenericClosure) {

        DispatchQueue.global(qos: .userInitiated).async {
            mobileClient.initialize { (userState, _) in
                if let userState = userState {
                    switch userState {
                    case .signedIn:
                        
                        completion(true, "Success", nil)
                        
                    default:
                        completion(false, "Failed", nil)
                    }
                } else {
                    completion(false, "Failed", nil)
                }
            }
        }
    }

Areas of the SDK you are using (AWSMobileClient, Cognito, Pinpoint, IoT, etc)?

  • AWSMobileClient

Screenshots
If applicable, add screenshots to help explain your problem.

Environment(please complete the following information):

  • SDK Version: 2.36.3
  • Dependency Manager: CocoaPods
  • Swift Version : 4.0
  • Xcode Version: 15.4

Device Information (please complete the following information):

  • Device: iPhone 14 Plus
  • iOS Version: 17.5.1
  • Specific to simulators:
  • All devices are being effected
@thisisabhash thisisabhash added bug Something isn't working mobile client Issues related to AWSMobileClient labels Aug 9, 2024
@thisisabhash
Copy link
Member

Thank you for posting the issue - could you please share verbose logs with sensitive information removed and reproduction steps? Have you made any changes to your backend resources recently? Which region is the cognito resource located in and from which region is it accessed?

@ruisebas ruisebas added the pending-community-response Issue is pending response from the issue requestor label Aug 15, 2024
@ruisebas ruisebas closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2024
@github-actions github-actions bot removed pending-community-response Issue is pending response from the issue requestor closing soon labels Sep 27, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mobile client Issues related to AWSMobileClient
Projects
None yet
Development

No branches or pull requests

3 participants