Using 25 March 2011 SC8 Power Nightly, executing the following code results in the fetchData callback being called twice. Each time it has the correct data, but the transactionNumbers are sequential.
Subsequent calls of goFetch() only fire the callback once, as I'd expect.
I thought at first it might have been my sub-classing and over-writing of transformRequest and transformResponse (even though I was still calling the Super(...) versions). However, I boiled it down to this test case and I hope that the fix will fix my more complex usage.
The same thing seems to happen if criteria is null, although it is correctly filtering the data.
Subsequent calls of goFetch() only fire the callback once, as I'd expect.
I thought at first it might have been my sub-classing and over-writing of transformRequest and transformResponse (even though I was still calling the Super(...) versions). However, I boiled it down to this test case and I hope that the fix will fix my more complex usage.
The same thing seems to happen if criteria is null, although it is correctly filtering the data.
Code:
isc.RestDataSource.create({ ID:"testDS", dataFormat:"json", dataURL:"/rest", // Real, although irrelevant to this example fields:[ { name:"id", type:"integer", primaryKey:true }, { name:"name" } ] }); testDS.setCacheAllData(true); testDS.setCacheData([{id:1,name:"first"},{id:2,name:"second"}]); function goFetch() { var criteria = {id:1}; testDS.fetchData(criteria,function(dsResponse,data){ console.warn("fetchData transactionNum:" + dsResponse.transactionNum + " length:" + data.length); }); } goFetch();
Comment