-
Notifications
You must be signed in to change notification settings - Fork 266
Description
Description
We are developing an Application which uses Amplify Datastore and Cognito UserPools authentication.
On Android, Datastore fails to start SYNC_VIA_API with an exception when resuming App from background. This happens when the App is put to background for a longer time. We stop the Datastore when App goes to background and start it again when App is resumed. If the pause has not been long, the app is able to resume SYNC_VIA_API but often after a longer pause API sync fails to start with "ApiException{message=Interrupted waiting for Cognito Userpools token". This only happens on Android, iOS seems to work perfectly.
It also seems that there is no way to detect this error from the App and restarting Datastore does not work after this condition has happened.
E/amplify:aws-datastore(25708): Failure encountered while attempting to start API sync. E/amplify:aws-datastore(25708): DataStoreException{message=DataStore subscriptionProcessor failed to start., cause=DataStoreException{message=Timed out waiting for subscription processor to start., cause=null, recoverySuggestion=Retry}, recoverySuggestion=Check your internet.}
W/amplify:aws-datastore(25708): DataStoreException{message=Error during subscription., cause=ApiException{message=Interrupted waiting for Cognito Userpools token., cause=java.lang.InterruptedException, recoverySuggestion=Sorry, we don’t have a recovery suggestion for this error.}, recoverySuggestion=Evaluate details.}
Categories
- Analytics
- API (REST)
- API (GraphQL)
- Auth
- Authenticator
- DataStore
- Notifications (Push)
- Storage
Steps to Reproduce
- Start app
- Wait for API sync to finish
- Put app to background
- Wait for 30 minutes
- Resume App
-> API sync fails to start
Screenshots
No response
Platforms
- iOS
- Android
- Web
- macOS
- Windows
- Linux
Flutter Version
3.35.4
Amplify Flutter Version
2.6.6
Deployment Method
Amplify CLI (Gen 1)