-
Notifications
You must be signed in to change notification settings - Fork 247
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
Initial GraphQL API sync fails (using Amazon Cognito User Pools authentication) when user not logged #736
Comments
Thanks for raising this issue, will investigate as soon as possible. |
This is a bug report I just filed that includes a couple of bugs I found and the workarounds to each |
Any updates on this? I am working on a project that requires access to DataStore before the user logs in. Adding the cognito user pool authentication gives the error:
|
i face the relate problem, too. in the app, different use login and get the data from cloud, it seems to get the same data. it would not be different even the account is different |
As this comment pointed out, amplify-flutter triggers initial sync regardless auth rule settings and if there is a valid user signed in. This behavior will be fixed. The dependencies of amplify-flutter, amplify-ios and amplify-android both silently handle exceptions happening within API sync, when this happens, both libraries fall back to local mode, and try to resume when invoking DataStore Before the the initial sync issue gets fixed, a workaround can be used here to mitigate: After user signs in successfully, can invoke
|
Hi @jsw-davidhuang I'm not sure the issue you describe in the comment is related to issue describe in the main thread. Could you please elaborate? |
i think what @Perniciosius faced is relate to how to design the schema file, he can use rules like:
to make the data only for the login users instead of a public data. |
Hi @jsw-davidhuang a quick follow up :) |
i solve it by adding @auth(rules: [{ allow: owner }]) , thanks |
@Perniciosius are you still experiencing this issue? |
This unexpected behavior now is fixed with version 0.3.0. |
Unrelated, but how do I enable the debug log in my console for finer tuned debugging? I am emulating on an iOS simulator and running the app through VS code run & debug console |
Describe the bug
When using private auth using Amazon Cognito User Pools for authentication of graphql API. During first app startup, Datastore tries to sync to cloud even if currently no user is logged in, which causes the sync to fail.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Initial sync should wait till user login. Only after logging in user, the initial sync should start.
Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):
[✔️] Android
[✔️] iOS
Additional context
The issue can be fixed if sync can wait till user login.
The text was updated successfully, but these errors were encountered: