PDA

View Full Version : [FIXED] [4.2.0 GA] Changing id in filtered store skips snapshot



cabal
14 Apr 2013, 10:23 PM
REQUIRED INFORMATION
Ext version tested:

Ext 4.2.0 GA

Browser versions tested against:

FF20

DOCTYPE tested against:

HTML 4.01 Transitional

Description:

When creating and synchronizing new record in filtered store, id is commited only to data, snapshot is skipped. On next store filter it creates error - record cannot be found by id, because map in snapshot contains tamporary record id

Steps to reproduce the problem:

Filter store
Add new record
Sync
Filter again
Try to get record by id (as for example data view do to add mouseOverCls)

HELPFUL INFORMATION
Possible fix:

Ext.define('Fixed.Store', {
override: 'Ext.data.Store',

onIdChanged: function(rec, oldId, newId, oldInternalId) {
if (this.snapshot) {
this.snapshot.updateKey(oldInternalId, newId);
}

this.callParent(arguments);
}
});

slemmon
15 Apr 2013, 8:21 AM
I'm having trouble reproducing the issue. I tried modifying the CRUD writer example in the SDK to add/filter/filter again running on FF and Chrome and did not see the same error you're describing.

Perhaps I'm missing something when attempting to reproduce the issue?

cabal
15 Apr 2013, 9:34 AM
It is not add/filter/filter.
It's filter/add/filter cycle.

During add, the temporary id is changed in map (MixedCollection, store.data), but not in snapshot created during first filter. On second filter, snapshot is restored and it's map is invalid.

slemmon
17 Apr 2013, 2:15 PM
Thanks for the report! I have opened a bug in our bug tracker.