-
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
DataStore sync issue from offline saved models (custom type fields) #2710
Comments
Hi @999Rub did the console log the stack trace when this error happens? Could you share more logs? I'd like to identity where the exception originated in the code and further to know where to look. |
Here's all I've got:
As I can see in the AmplifyDatastore.db that my model is correct (and in fact it is correct because its working with full online). |
The problem seems comes from the serialization of custom type in this Model, but I've tried to delete the 'charts' field as it's mentioned in the exception and the error still occurs on every custom types of this Model. The curious thing is, when I try to create the same issue with another Model (with the exact custom types too), this is working without any exception. When one of its model is saved offline and try to be synced at the restart of the program online and failed, every next future instances of this model will fail to sync (even if they're saved online this time). I can't get why it is working on a model and not on the other one, while they have both custom types with basics field types (string, int, double, lists..). I do an update of my sync expressions at runtime (sync expressions doesn't have any effect regarding the behavior when I comment it or not). When I only retrieve my data from the cloud (without offline saved before), and comment both Maybe should I do not use Custom Types but general Models instead and just workaround with relation between each models ? |
Thanks @999Rub the exception seems happening when clearing pending mutation box when your device is back online and deserializing stored data from the local DB (PendingMutationBox table rather than the actual |
Quick follow up @999Rub which amplify-flutter version you are testing with? |
@HuiSF The amplify-flutter version is mentioned above but I use the 10.7.3 version. The most mysterious thing to me (I don't know if you know why?), but why this issue occurs only on this model and not on the other ones (wich have custom types too) ? |
Hi @999Rub sorry for the confusion, I believe |
@HuiSF You right this is the Amplify CLI version, sorry for the misunderstanding, my actual version is |
Hi @HuiSF , is there anything new from your side ? |
Hi @999Rub sorry for the delay, I will dig into this issue today. |
Don't worry, I have at least 2 or 3 weeks left to solve this issue. |
@HuiSF i have also same issue, i am using latest one amplify_auth_cognito: 1.0.0-next.6 |
Yep, same here with the |
Hi @HuiSF , I saw your PR and how the issue's fix evolve last month. What are the news/state about it ? Thanks for you work and time. |
Hi @999Rub we are working with amplify-android maintainers to test and merge the PRs, will update the progress, thank you for your patience. |
Hi @HuiSF , I've seen that the open issue has been merged into main branch, thanks for you work and Amplify team's work. Do you have any idea about when the fix will be available on the pub.dev ? Or maybe I don't have to wait that's available on pub.dev and simply pull the fix ? Regards. |
Hi @999Rub thanks for watching the progress! We are currently waiting for amplify-android releases, then we can integrate the fix into amplify-flutter. Amplify Android release should happen this week. We'll follow up ASAP once they release the new versions. |
Hi @HuiSF , I've seen a new update on pub dev for the v0 of amplify_flutter wich include your fix for this issue (from https://github.com/aws-amplify/amplify-flutter/releases/tag/v0.6.14 ), thanks for the work. Regards. |
Thank you for the feedback @999Rub ! Closing this issue 👍 |
Description
This bug report is really close to aws-amplify/amplify-android#1199 from the amplify-android.
I've got a GraphQL model (wich is provided in schema section) that I can save offline or online. When I use the app online, absolutely everything works fine.
When I launch the app online, then turn off the internet connectivity, create and save a new model, it is locally saved properly. Then I end up the program (still offline), turn back the internet and run the program again (online).
The sync is processing, I can retrieve the data from my cloud, but the model that was saved in offline mode is not synced with the cloud.
It actually gives me a mix of DataStore and Amplify exception :
Regarding the Android issue mentioned above, I think my issue is really close to the same fix but I can't how to overpass it.
The thing that is really curious is, when I run the program, then turn off internet, create and save a model, and turn on internet (without closing the program this time), the model is correctly synced with my cloud.
I use the Auto Conflict resolver.
My Flutter doctor is fine.
If you need more details tell my and I will give you as much as I can.
Categories
Steps to Reproduce
Screenshots
No response
Platforms
Flutter Version
3.7.3
Amplify Flutter Version
10.7.3
Deployment Method
Amplify CLI
Schema
The text was updated successfully, but these errors were encountered: