Comments (6)
@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.
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.
@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.
Thanks for the info @joelmbell
I will try to reproduce on my end as well.
from aws-mobile-appsync-sdk-ios.
@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.
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)
- Prebuilt frameworks using Swift 5.5 (Carthage) HOT 17
- Memory leak in AppSyncRealtimeClient HOT 2
- AWSNetworkTransport Error when initializing AWSAppSync in AppDelegateFile SwiftUI - Xcode 13.1 HOT 4
- Add support for Custom Domain Names for AWS AppSync APIs HOT 8
- AWS AppSync SDK with AppSync APIs v2 protocol (pure WebSockets) HOT 1
- AWSAppSyncClient: AWSPerformMutationQueue Crash HOT 2
- Crash: AWSAppSyncClient.sync HOT 5
- Removing pods from source control HOT 2
- AWSMobileClient Crash when app starts HOT 3
- Completion Handler on AWSAppSyncClient.perform called more than once. HOT 1
- Enabling retry for custom scenarios HOT 1
- Update SQLite dependency to match Amplify.DataStore's SQLite version
- Make public constructor for GraphQLError HOT 2
- SPM dependency conflict with Amplify library HOT 6
- Using AWSAppSync with Amplify DataStore HOT 5
- App crashes: AWSAppSync $s10AWSAppSync36AWSCognitoUserPoolsAuthProviderAsyncPAAE09getLatestF5TokenSSyF HOT 1
- SPM dependency resolution failure using aws-mobile-appsync-sdk-ios 3.6.2 and amplify-swift 2.6.0 HOT 2
- AWS subscriptions - subscribe function is not thread safe and causes crashes HOT 1
- Version incompability with other amplify packages HOT 2
- Unknow TCP connection process keep running even when all subscriptions are unsubscribed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-mobile-appsync-sdk-ios.