Coder Social home page Coder Social logo

Comments (6)

joelmbell avatar joelmbell commented on May 20, 2024 1

@rohandubal closing this, you may have missed my above comment explaining that it was an implementation detail on my end causing this.

In short, the callback in getLatestAuthToken wasn't getting called for the second request. Since that callback wasn't getting called it caused the mutations resultHandler to not be called as well.

Thanks for looking into this, and for responding so quickly!

from aws-mobile-appsync-sdk-ios.

rohandubal avatar rohandubal commented on May 20, 2024

Thanks for reporting this @joelmbell

We have a bunch of functional tests where we run about 18 mutations in a for loop which passes: https://github.com/awslabs/aws-mobile-appsync-sdk-ios/blob/master/AWSAppSyncTests/AWSAppSyncTests.swift#L324

Which auth mechanism you are using? (AWS_IAM, API_KEY, UserPools?)

Thanks,
Rohan

from aws-mobile-appsync-sdk-ios.

joelmbell avatar joelmbell commented on May 20, 2024

@rohandubal I am using the new AWSCognitoUserPoolsAuthProviderAsync auth mechanism.

I'll continue testing on my end, I should be able to narrow it down further.

from aws-mobile-appsync-sdk-ios.

rohandubal avatar rohandubal commented on May 20, 2024

Thanks for the info @joelmbell

I will try to reproduce on my end as well.

from aws-mobile-appsync-sdk-ios.

joelmbell avatar joelmbell commented on May 20, 2024

@rohandubal the more I look at this, it seems like its actually an issue the Cognito SDK we're using to fetch the token in func getLatestAuthToken(_ callback: @escaping (String?, Error?) -> Void)

The sdk is never calling its callback the second time a token is requested, so the callback to this function isn't getting called, which is just bubbling up the stack to the actual mutation resultHandler

Given that this isn't an issue with the actual AppSync SDK we can probably close this ticket and I'll handle that case in my application and possibly open a bug on the AWSCognitoAuth iOS proj

from aws-mobile-appsync-sdk-ios.

rohandubal avatar rohandubal commented on May 20, 2024

Hello @joelmbell

I tried re-producing on my side but was not able to. It worked as expected on SDK version 2.6.21

I was using the AWSUserPoolsSignIn (AWSCognitoIdentityProvider) SDK and this was the definition of my user pools provider:

class MyCognitoUserPoolsAuthProvider: AWSCognitoUserPoolsAuthProviderAsync {
    
    func getLatestAuthToken(_ callback: @escaping (String?, Error?) -> Void) {
    AWSCognitoUserPoolsSignInProvider.sharedInstance().getUserPool().currentUser()?.getSession().continueWith(block: { (task) -> Any? in
            if let error = task.error {
                callback(nil, error)
            } else if let token = task.result?.idToken?.tokenString {
                callback(token, nil)
            }
            return nil
        })
    }
}

Does your code look similar? I think I might need a some repreo steps or a small sample app from you where I can debug this.

Thanks,
Rohan

from aws-mobile-appsync-sdk-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.