senchauser2010
28 Jan 2011, 6:37 AM
I am having trouble adding/deleting records to local storage using WebStorageProxy. I saw a bug report regarding deletion, but not sure if they are caused by the same issue.
I noticed that even when a record is added to the local store, it fires delete for some other records, and the ids attribute of WebStorageProxy has all sorts of dupes.
On stepping through the code, I found that destroy function of WebStorageProxy does not call the following, while other methods like read/update/create do.
//following is not called in destroy function
operation.setCompleted();
operation.setSuccessful();
Which leads to operation.wasSuccessful() to return false even if records were deleted and onProxyWrite callback of store does not clear this.removed array. So next time if there is another request (like create), it again tries to delete these records since this.removed array still has those records and it goes on forever.
Am I misinterpreting something or is this a known issue?
I noticed that even when a record is added to the local store, it fires delete for some other records, and the ids attribute of WebStorageProxy has all sorts of dupes.
On stepping through the code, I found that destroy function of WebStorageProxy does not call the following, while other methods like read/update/create do.
//following is not called in destroy function
operation.setCompleted();
operation.setSuccessful();
Which leads to operation.wasSuccessful() to return false even if records were deleted and onProxyWrite callback of store does not clear this.removed array. So next time if there is another request (like create), it again tries to delete these records since this.removed array still has those records and it goes on forever.
Am I misinterpreting something or is this a known issue?