-
Notifications
You must be signed in to change notification settings - Fork 119
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
DataStoreException prevents syncing when saving same object quickly #2151
Comments
I was able to reproduce this in a flutter app while getting a slightly different error. Once the error happens, the device db is in an inconsistent state and syncing up to the cloud is broken until the app data is reset. The error I got looks like this:
With these versions:
As PS-MS mentioned, this is outside of designed usage parameters of the library, but at the same time it should not be so easy to bork the client with a common programming error. |
We are getting similar exception as below, is there any possible way to catch this kind of exception and continue with the sync?
|
we see this... Is it possible the mutations are getting batched into an update and the create is being lost? |
Hi, Agree with @stevegaunt , for me it is a high priority bug because of data loss. Is there any update ? |
@JeremyLabelIO What is the scenario where you are seeing data loss occur? Is it in bad network scenarios, or is there a scenario in your application that rapidly attempts to create/update the same model. Will try and prioritize picking research back up on this ticket. |
It is in bad network scenarios. The best way to reproduce is to unplug RJ45 cable from the router (the device is still connected in WIFI but without Internet) and replug after 3 seconds. And almost everytime I have the same issue :
|
Thanks for the additional context. |
Hey @JeremyLabelIO, do you have the rest of the logs from run? I'm interested in what happened with the sync logs* from the first save. It should be look like
*verbose logging on
|
We have recently released https://github.com/aws-amplify/amplify-android/releases/tag/release_v2.19.1 that has a fix for the crash. Please reach out again if you are still seeing issues, or if there are more details to share with us. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Before opening, please confirm:
Language and Async Model
Kotlin
Amplify Categories
GraphQL API, DataStore
Gradle script dependencies
// Put output below this line
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
Our website was failing to receive updates after saving some data, after some investigation it turned out to be developer error saving the same object multiple times. e.g.
Click save -> save data -> save event callback -> save data
DataStoreException{message=Outbox was asked to remove a mutation with ID = 18f158a3-7230-11ed-9b69-65a8d87b846b. However, there was no mutation with that ID in the outbox, to begin with
.Although it was a mistake to save twice, I'd still expect DataStore to manage the mutation id's correctly and not fall over
Reproduction steps (if applicable)
Note: the bug cause was with saving parent and child data, saving around 30 entries twice however I've been able to reproduce it with the below. If this doesn't cause the exception, increase the repeat count as it appears to be about timing.
Code Snippet
// Put your code below this line.
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: