Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

deleted records can not be added again #61

Open
zoul0813 opened this issue Mar 12, 2018 · 1 comment
Open

deleted records can not be added again #61

zoul0813 opened this issue Mar 12, 2018 · 1 comment

Comments

@zoul0813
Copy link

I'm attempting to create a dictionary of values in a dataset, when I add a key to the dataset and synchronize everything works fine. If I delete that key by calling dataset.remove and synchronize everything works fine here too.

The problem is when I try to add that same key back in after it's been removed previously and synchronize. My local dataset shows the value, and when I call dataset.synchronize none of my callbacks are being fired ... but I can see the request in Chrome's network log, as well as in the Cognito Sync Event trigger that is being called.

I enabled logging on the sync manager, and during a successful sync (adding or removing the item for the first time), I get a sync successful message ... however, when trying to add the item back in and sync, the last message I get is Nothing updated remotely. Pushing local changes to remote.

@zoul0813
Copy link
Author

I did a few more tests, it looks like the issue is related to Cognito Sync Events.

When the remote record is marked as deleted, the Cognito Sync Event trigger is calling the lambda function with 'recordKey': null rather than 'recordKey': { oldValue: null, newValue: 'whatever', op: 'replace' }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant