Skip to content
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

AppSync deletes mutation before calling http that leads to lost of data #40

Closed
danielvtan opened this issue Sep 17, 2018 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@danielvtan
Copy link

danielvtan commented Sep 17, 2018

Describe the bug
PersistentOfflineMutationManager.java deletes mutation even before successful http call leads to data loss

Expected behavior
mutation should only be deleted after a successful http call
deletion of mutation should be call after httpCall.enqueue on success response
should be retried on fail
.

Environment(please complete the following information):

  • AppSync SDK Version: 2.6.25+

Additional context
`
// PersistentOfflineMutationManager.java

public PersistentOfflineMutationObject removeAndGetLastInQueue() {
if (persistentOfflineMutationObjects.size() >= 1) {
PersistentOfflineMutationObject mutationObject = persistentOfflineMutationObjects.remove(0);
mutationSqlCacheOperations.deleteRecord(mutationObject.recordIdentifier); // <- deletes before http success
return mutationObject;
}
throw new IllegalStateException("Persistent Mutation Queue is empty. Cannot remove object.");
}`

@scb01
Copy link
Contributor

scb01 commented Dec 8, 2018

@danielvtan

Wanted to let you know that I am looking into this as part of my investigation into #33

@scb01
Copy link
Contributor

scb01 commented Dec 19, 2018

@danielvtan

Version 2.7.1 of the SDK contains queuing logic to address the issue that you reported. Please upgrade to this version and let us know how you fare.

I will close this thread and lets use #33 for tracking purposes.

@scb01 scb01 closed this as completed Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants