Open HarkerTech opened 2 years ago
Hi @HarkerTech will take a look using our datastore example app to reproduce
Hi @HarkerTech thank you for submitting this issue. I am able to reproduce this issue in our Datastore example app.
On Android 30, I am able to save Blog/Post objects and see those objects on app restarts.
On Android 25, I am able to save Blog/Post objects but sometimes they do not appear in the list of saved models. Regardless they are all lost on app restart. However, the save method succeeds, and those Blog/Post objects are displayed on the Android 30 device.
ObserveQuery.listen is not being called at all for Blog/Post (which have fields) while it is still called for Comment (of which there are none). It seems when a list should be returned for ObserveQuery listen something on the native side is breaking that is causing listen to not be called on the Dart side.
We'll look into this more internally. Might be an issue with underlying Amplify Android.
@HarkerTech - Apologies for the long delay in an update. I attempted to reproduce this with the latest version of Amplify Flutter (2.0) and was unable to. If you are still facing this issue can you attempt to reproduce with the latest version? It is possible this was previously an issue that has been fixed since. If you can still reproduce this, can you provide the schema you are using? Thanks.
Also please note that you will need to follow these set up steps to support API level 24 - https://docs.amplify.aws/gen1/flutter/build-a-backend/more-features/datastore/set-up-datastore/#update-the-android-project
@HarkerTech - I am going to change this to a docs issue. While I was able to get this working in the example app in this repo, the set up steps linked above seem insufficient for a new Flutter app. I think there may be some set up steps missing from our docs for the latest version of Flutter / Amplify Flutter.
Description
Have seen this issue in our production app, however we have also replicated it in the tutorial amplified_todo app (https://docs.amplify.aws/start/getting-started/add-api/q/integration/flutter/).
On a fresh boot (delete app on emulator and rebuild) the first DataStore sync/observeQuery runs as expected and returns results. However after restarting the app after the successful sync the query will fail to return any results. We did not observe any errors in the logs.
Have not tested on Android versions older than API 24, however on API 26 the queries completed successfully.
Categories
Steps to Reproduce
Screenshots
No response
Platforms
Android Device/Emulator API Level
API 24, API 25
Environment
Dependencies
Device
Huawei P9
OS
Android 7.0
Deployment Method
Amplify CLI
CLI Version
9.2.1
Additional Context
No response
Amplify Config
const amplifyconfig = ''' { "UserAgent": "aws-amplify-cli/2.0", "Version": "1.0", "api": { "plugins": { "awsAPIPlugin": { "AmplifiedTODO": { "endpointType": "GraphQL", "endpoint": "", "region": "ap-southeast-2", "authorizationType": "API_KEY", "apiKey": "" } } } }, "auth": { "plugins": { "awsCognitoAuthPlugin": { "UserAgent": "aws-amplify-cli/0.1.0", "Version": "0.1.0", "IdentityManager": { "Default": {} }, "AppSync": { "Default": { "ApiUrl": "", "Region": "ap-southeast-2", "AuthMode": "API_KEY", "ApiKey": "", "ClientDatabasePrefix": "AmplifiedTODO_API_KEY" }, "AmplifiedTODO_AWS_IAM": { "ApiUrl": "", "Region": "ap-southeast-2", "AuthMode": "AWS_IAM", "ClientDatabasePrefix": "AmplifiedTODO_AWS_IAM" } }, "CredentialsProvider": { "CognitoIdentity": { "Default": { "PoolId": "", "Region": "ap-southeast-2" } } }, "CognitoUserPool": { "Default": { "PoolId": "", "AppClientId": "", "Region": "ap-southeast-2" } }, "Auth": { "Default": { "authenticationFlowType": "USER_SRP_AUTH", "socialProviders": [], "usernameAttributes": [ "EMAIL" ], "signupAttributes": [], "passwordProtectionSettings": { "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [ "REQUIRES_LOWERCASE", "REQUIRES_NUMBERS", "REQUIRES_SYMBOLS", "REQUIRES_UPPERCASE" ] }, "mfaConfiguration": "OFF", "mfaTypes": [ "SMS" ], "verificationMechanisms": [ "EMAIL" ] } } } } } }''';