Flutter app datastore not syncing with DynamoDB

54 views Asked by At

My flutter app cannot retrieve the newly added item in the DynamoDB.

I have an item(id: abc012345) in the dynamodb. My flutter app allows me to display the item by their id. Initially, I searched the item(id: abc012345) and displayed on my app. When I removed it from the dynamodb with a lambda function using appsync (ttl is 0, so it's gone immediately), the item is removed and disappeared on my app, which is an expected behaviour. However, when I create a new item with the same id(abc012345) in the dynamodb and go through the same process again, my app cannot find the item while adding an item with a different id is fine. I need to manually clear the phone internal storage to make it sync again.

I guess reusing the id causes inconsistencies between the cached data and the actual data from the backend. What can I do if I really have to reuse the id?

0

There are 0 answers