Closed MarioCdeS closed 1 year ago
Hi @MarioCdeS 👋, Thanks for raising this issue.we are working on reproducing the issue. Could you please run below command and send us the report.
amplify diagnose --send-report
.
please refer here
Hey, @AnilMaktala.
Thanks very much for assisting. The report archive has been uploaded. The PI is 1ec424ae6419fc281983cb7d68b43bc1.
@MarioCdeS Are you seeing any errors or warnings in the browser console when this occurs? Whether at the time you delete the records, after restarting the app, or when clearing DataStore and then restarting?
If you can consistently reproduce this, please try doing a repro with the network tab open and recording — see if you can spot any graphql errors or mutations occurring at unexpected times, like after you'd expect DataStore to already be "ready". On that note, can you confirm that DataStore has emitted its ready event prior to your interactions with the data?
Information about the ready event is here: https://docs.amplify.aws/lib/datastore/datastore-events/q/platform/js/#ready
If you can share any app code representing a minimal reproduction, that would be very helpful too.
@MarioCdeS can you please confirm some of the details so we can better investigate this? We're curious to see if, when calling DataStore.delete, the records are being removed from the local store or not.
Hi, @svidgen / @chrisbonifacio.
There are no errors generated when deleting the record for the first time, nor when restarting the app, nor clearing DataStore.
On startup, the client application waits for the DataStore ready event before proceeding with any queries. Examining the network traffic reveals no unexpected GraphGL mutations nor errors.
If I attempt to delete the "phantom" record, the delete mutation fails with ConflictUnhandled: Conflict resolver rejects mutation
.
I, unfortunately, do not have any code that I can share right now. Below is a sequence diagram of events during repro, if it helps at all.
Any updates on this? I am facing the same issue
@MarioCdeS I haven't been able to reproduce this on the latest version of aws-amplify
.
@CristianGrosu2022 @MarioCdeS Can you both let us know what conflict resolution strategy you might have configured? (Auto Merge, Optimistic Concurrency, etc)
@CristianGrosu2022 What version of aws-amplify
are you using? Also, if you have any code snippets of how you're deleting records or reproduction steps for how you're running into the issue, please share!
When the ERR: Conflict resolver rejects mutation
part occurs, are there any outgoing mutations in the network activity? If so, what is the version number that was sent? Looks like the first mutation returned an incremented version for the record, but the version of the record on the server did not change.
This would suggest that the delete update mutation never actually succeeded. This behavior sounds like optimistic concurrency to me but I'd like to confirm.
Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you.
Thank you!
Facing same issue
Experiencing the same issue:
In both offline and online modes, I perform the following actions:
Create a single item Update the created item Delete the item When I directly check the DynamoDB table, I observe that the item's _version is correctly incremented to 3, and _deleted is set to true. This signifies the three actions (create, update, delete).
After the deletion, the response from the app confirms the deletion, and subsequent queries do not show the deleted item, which is the expected behavior.
However, the problem arises when I kill the application and restart it. Upon returning, the deleted item reappears. Upon inspecting the deleted record, I notice that it returns with a _version less than the last updated version.
In cases where I always receive _deleted: null when restarting the app, the deleted item is correctly not displayed.
I want to highlight that there are no errors reported during the delete action or when restarting the application. For the delete operation, I'm using the following query:
DataStore.delete(TableName, id); If anyone has encountered a similar issue or has suggestions on how to address this, I would greatly appreciate your insights and assistance.
Thank you!
Experiencing the same issue:
In both offline and online modes, I perform the following actions:
Create a single item Update the created item Delete the item When I directly check the DynamoDB table, I observe that the item's _version is correctly incremented to 3, and _deleted is set to true. This signifies the three actions (create, update, delete).
After the deletion, the response from the app confirms the deletion, and subsequent queries do not show the deleted item, which is the expected behavior.
However, the problem arises when I kill the application and restart it. Upon returning, the deleted item reappears. Upon inspecting the deleted record, I notice that it returns with a _version less than the last updated version.
In cases where I always receive _deleted: null when restarting the app, the deleted item is correctly not displayed.
I want to highlight that there are no errors reported during the delete action or when restarting the application. For the delete operation, I'm using the following query:
DataStore.delete(TableName, id); If anyone has encountered a similar issue or has suggestions on how to address this, I would greatly appreciate your insights and assistance.
Thank you!
Same issue here. Did you resolve the problem?
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
DataStore
Amplify Categories
storage, api
Environment information
Describe the bug
I am experiencing a weird issue where data, that was previously deleted, is reappearing in query results. The client deletes items via
DataStore.delete()
. Examining the DynamoDB table, the items have been flagged as deleted. The delta table reflects the same. The client is set up to observe mutations on the related model, and it does receive the resultingDELETE
messages. At this point, any subsequent queries on the model behave as expected i.e. the deleted items are not returned. I only experience problems once I restart the client app.After restarting, the previously deleted items are now returned in the query results. The items are still flagged as deleted in the DynamoDB table, so the issue is with the local cache. Clearing the cache (
DataStore.clear()
) fixes the issue, however, this isn't a viable solution.I noticed that there was a similar issue reported previously, though it doesn't seem to have been resolved: https://github.com/aws-amplify/amplify-cli/issues/1868
Any pointers or advice on how to resolve this problem would be greatly appreciated.
Expected behavior
Deleted items should remain deleted on client.
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response