FlexibleAdapter icon indicating copy to clipboard operation
FlexibleAdapter copied to clipboard

Probable major bug in private filterItemsAsync() method.

Open mecoFarid opened this issue 4 years ago • 0 comments

filterItemsAsync() always checks for a new filter. If filter parameters haven't been changed then filtering will be omitted here:

private synchronized void filterItemsAsync(@NonNull List<T> unfilteredItems) {
        // Omitted for brevity 
        if (hasFilter() && hasNewFilter(mFilterEntity)) { //skip when filter is unchanged

        }
    }

Steps to reproduce: Let's take a simple situation where each item has a status field called isSent.

  1. Add a few items to the adapter where isSent = false
  2. Apply filter where only items with isSent = false should be visible
  3. Change status of any single item item to isSent = true and the call FlexibleAdapter.filterItems()
  4. Since the filter itself hasn't changed, the filtering will, simply, be omitted

mecoFarid avatar Apr 30 '20 12:04 mecoFarid