-
Notifications
You must be signed in to change notification settings - Fork 117
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
Pending mutation in mutation outbox breaks synchronization process. #2077
Comments
Hi @vitalnik thanks for reporting this issue. it sounds like the sync engine is not recovering and reconnecting after the exception. As amplify-flutter library is not involved within the sync engine work flow, I will forward this issue to amplify-android repository for further triage. |
Are there any updates on this issue? Or if you can suggest a workaround that would be greatly appreciated. |
Hey @vitalnik 👋, we are testing out potential fix for this issue and we will report back with the updates soon. |
|
Description
Recreated the issue in a simple Todo Flutter project. Testing it on Android 11.
Adding local record to the DataStore while throttling Internet connection is causing this exception:
Error ended observation of mutation outbox: DataStoreException{message=Timeout processing PendingMutation{mutatedItem=SerializedModel{id='c11922ab-8d0d-4d2b-97a2-5c42abb38ab1', serializedData={name=Task 154, createdAt=null, description=MOBILE, id=c11922ab-8d0d-4d2b-97a2-5c42abb38ab1, updatedAt=null}, modelName=Todo}, mutationType=CREATE, mutationId=a720ed51-5a06-11ed-ae33-7dfddaac416a, predicate=MatchAllQueryPredicate}, cause=null, recoverySuggestion=Check your internet connection.} at com.amplifyframework.datastore.syncengine.MutationProcessor.drainMutationOutbox(MutationProcessor.java:120) at com.amplifyframework.datastore.syncengine.MutationProcessor.lambda$startDrainingMutationOutbox$1$com-amplifyframework-datastore-syncengine-MutationProcessor(MutationProcessor.java:101) at com.amplifyframework.datastore.syncengine.MutationProcessor$$ExternalSyntheticLambda3.apply(Unknown Source:4) at io.reactivex.rxjava3.internal.operators.observable.ObservableFlatMapCompletableCompletable$FlatMapCompletableMainObserver.onNext(ObservableFlatMapCompletableCompletable.java:97) at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201) at io.reactivex.rxjava3.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255) at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65) at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
The timeout exception makes sense to me since the connection is limited.
After establishing stable Internet connection all other local updates made to the Todo table not making it to the remote DataStore. Updates got enqueued but never processed. Amplify Hub issued the corresponding OutboxMutationEvent event.
Seeing this in Android Studio logcat after adding more local Todo records:
Mutation outbox has pending mutation for [id]. Saving the metadata, but not model itself
The only way I can get around this issue is to call DataStore.clear() and then DataStore.start() to reload everything, but in that case I'm loosing all local updates.
Categories
Steps to Reproduce
Screenshots
No response
Platforms
Android Device/Emulator API Level
API 29
Environment
Dependencies
Device
Pixel 2
OS
Android 11
Deployment Method
Amplify CLI
CLI Version
10.3.2
Additional Context
No response
Amplify Config
{
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"api": {
"plugins": {
"awsAPIPlugin": {
"simpletodo5sync": {
"endpointType": "GraphQL",
"endpoint": "xxx",
"region": "us-west-2",
"authorizationType": "API_KEY",
"apiKey": "xxx"
}
}
}
}
}
The text was updated successfully, but these errors were encountered: