-
Notifications
You must be signed in to change notification settings - Fork 58
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
Cognito Userpools failed to get session #325
Comments
A few suggestions of things to check:
|
|
The same issue on Android 6,8,10. I don't have awsconfiguration.json file. Issue happens randomly. |
Hello, Here's the awsconfiguration.json
Here's how the
The user is signed in when the issue occurs. First I'm getting the AppSyncSubscriptionCall.Callback::onFailure call on my active subscription. Then the |
Any suggestions? |
@itslonua are you trying to point to the @div5yesh I'm also facing the same issue since few months. Unable to reproduce 100% time at my end but I can see many occurrences in Crashlytics logs. I'm using: I observed one thing from my Crashlytics though. Most of the times, it's either crashing immediately after login or it is crashing when user closes the app and returns to the app after few hours. @zhangjiancheng did you find any solution for this? |
Is there any resolution for this. Its happening at least once per day per user. I am also on
|
Is this happening on lower version devices like <23 ? If not then I would highly recommend upgrading to Amplify V2 for all your Amplify needs including Auth and Appsync. That is built ontop of the latest kotlin sdk and redesigned entirely in Kotlin. |
@gpanshu On further debugging, this issue seems to happen when the client has internet connectivity issues and when the WebSocket tries to reconnect.
|
We did try upgrading to
|
@ksgangadharan you are using the SDK. Please try updating to amplify |
@gpanshu getting the same error. So I changed to use amplify, below is my build.gradle
And I am getting the same error as before:
|
@ksgangadharan just to understand your issue you login then after a period of inactivity call fetchAuthSession and you get this error ? |
@gpanshu I login, and then I try to create the AWSAppSyncClient object
Note, that I did manage to make this work temporarily by replacing the provider with this code:
where session was retrieved using |
What are the issues you are having with fetchAuthSession after the code has been running for a long time? |
@gpanshu there is no issue with fetchAuthSession. Problem is that fetchAuthSession is a coroutine and trying to integrate it with CognitoUserPoolsAuthProvider (which is a non coroutine code) is not straightforward and is prone to side effects That's the reason why we need the BasicCognitoUserPoolsAuthProvider to work. Note that this code was working earlier when the amplify version was 1.37.3 |
I see that you are using both the AWS Java SDK and Amplify together. They are not meant to be used together. Is there a use case you are trying to solve by using both of them. Have you tried only using Amplify V2 for Android to see if that solves your problem. |
There are 2 AWS sdk libraries that I am using, 1) Pinpoint library for registering for FCM notification, I don't see an alternative to that in the V2 amplify lib, and 2) the S3 library, and this is needed to attach a S3Object manager to the app sync client (refer Coming back to the original issue, what is the alternative for BasicCognitoUserPoolsAuthProvider. This is not referring to any of the AWS SDK classes, and it does not work |
I am also having the same issue using app sync with the latest amplify version. I am setting authentication with cognitoUserPoolsAuthProvider using the BasicCognitoUserPoolsAuthProvider. This was working fine with latest amplify version 1.37.5 but does not work anymore with 2.14.9. The token is always null. Amplify session object that retrieves tokens has changed and I am not sure if this is related with that situation |
@iolandarosa7 the 1.x version of Amplify depends on the AWS SDK for Android, which is compatible with the AppSync SDK here. However, the 2.x version of Amplify depends on the AWS SDK for Kotlin, which is not compatible with this library. |
@tjleing Thanks for your answer. Thanks |
Describe the bug
Friday opened the app and it runned in background thread, when Monday I make the app in front, the error occuces.
Environment(please complete the following information):
Device Information (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: