PDA

View Full Version : [FIXED] Wrong logic while removing records in local storage



yarus23
26 Apr 2012, 11:47 AM
REQUIRED INFORMATION
Ext version tested:

Sencha touch 2.0.1
Description:

While clearing all records in local storage setIds is called on every record deleting that is not optimal
Possible fix:

It is efficient not to make setIds every record, so it is smart to let 'destroy' method make it in batch, but we want to make in batch in 'clear' method and want to keep removeRecord method capable of removing record with no additional code
Here is a patch for: C:/xampp/htdocs/sencha-touch-2.0.1/src/data/proxy/WebStorage.js


@@ -162,7 +162,7 @@

for (i = 0; i < length; i++) {
Ext.Array.remove(newIds, records[i].getId());
- this.removeRecord(records[i], false);
+ this.removeRecord(records[i]);
}

this.setIds(newIds);
@@ -292,7 +292,7 @@
id = id.getId();
}

- if (updateIds !== false) {
+ if (updateIds) {
ids = me.getIds();
Ext.Array.remove(ids, id);
me.setIds(ids);





And please consider adding operation.setStarted(); in a destory method.

Jamie Avins
26 Apr 2012, 1:14 PM
Thank you for the report.

TommyMaintz
17 Jul 2012, 8:09 AM
This has been fixed for the next release.

Fanny144
17 Aug 2012, 3:21 AM
This has been fixed for the next release.


Has been fixed in the version 2.1.0 beta 2???