Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12974 closed defect (invalid)

"assertion failed in ItemFileWriteStore" in store._saveEverything

Reported by: vtsuper Owned by: Jared Jurkiewicz
Priority: high Milestone: tbd
Component: Data Version: 1.6.1
Keywords: "assertion failed in ItemFileWriteStore" Cc:
Blocked By: Blocking:

Description

the following code will generate err "assertion failed in ItemFileWriteStore?"

function saveDone(){alert('done');} 
function saveFailed(){alert('fail');} 

store._saveEverything = function(saveCompleteCallback, saveFailedCallback, newFileContentString){  
   alert(newFileContentString);
}
store.save({onComplete: saveDone, onError: saveFailed});

if I change execute 'saveCompleteCallback' and 'saveFailedCallback' once, then no error occurs.

store._saveEverything = function(saveCompleteCallback, saveFailedCallback, newFileContentString){  
   alert(newFileContentString);
   saveCompleteCallback();
   saveFailedCallback();
}

I must run the those function at least 1 time?

Change History (3)

comment:1 Changed 9 years ago by bill

Component: GeneralData
Owner: set to Jared Jurkiewicz

comment:2 Changed 9 years ago by Jared Jurkiewicz

Resolution: invalid
Status: newclosed

Yes, you have to run one of the callbacks at the end of your save events. Failure to do so leaves the store in a bad state.

If your save is successful, you run the completed callback.

If there is an error, you run the failed callback.

They handle some final post-save events..

comment:3 Changed 9 years ago by vtsuper

thank you for your suggestion. I know that this is not a bug now...thank you

Note: See TracTickets for help on using tickets.