Hi,

Based on couple of AsyncTree + FilterTree samples, i found a bug : Here is what append :


1)
When applying filters (applyfilters()) to a store, the store computes a 'filtered' list of elements that matters (visible).
He keeps a backup copy of 'all' list in a temp list called 'snapshot'
He replaces 'all' list reference with 'filtered' list.

2)
When clearing filters (clearFilters()), the store restore back the backup 'snapshot' list as the 'all'


Problem :
When loading items (TreeStore + Loader + RPCProxy), loaded items are added to the store (via insert() method). this method add items in the 'all' reference.

At this point, 'all' can be simply the 'filtered' list if store is filtered !!

So if store is filtered when async loading occurs, items will be added into the 'filtered' list version of 'all' and when filters will be creared, 'snapshot' will replace 'all' and references to these items are lost.

So : scenario :
Load root items.
Filter the store
Expand one of root items (causes async load)
Un-filter the store

: Loaded items that were Filtered by filter are completelly detached from store.

Workaround :
Override clearFilters() :

Code:
public void clearFilters() {
        if (isFiltered()) {
            filtersEnabled = false;
            
            // 'all' contains filtered items (those who are 'visible')
            // 'snapshot' contains a backup of what was in 'all' (aka all models) before filter was applied   
            
            // Inserting items in a filtered store implies inserting them in 'all'
            
            // So reseting 'all' with 'snapshot' bacup copy, check there's no item in 'all' that is not in snapshot
            for(M m : all){
                if(!snapshot.contains(m)){
                    snapshot.add(m);
                }
            }
            all = snapshot;
            snapshot = null;
            fireEvent(Filter, createStoreEvent());
        }
    }