Protect against individual item updates being put into an invalidated list.

fork-5.53.8
Greyson Parrelli 2021-11-22 10:40:06 -05:00
rodzic 1a9d785cbb
commit ef7d5d55cb
1 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -142,6 +142,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
return;
}
if (invalidated) {
Log.w(TAG, "Invalidated! Just before individual change was loaded for position " + position);
return;
}
Data item = dataSource.load(key);
if (item == null) {
@ -149,6 +154,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
return;
}
if (invalidated) {
Log.w(TAG, "Invalidated! Just after individual change was loaded for position " + position);
return;
}
List<Data> updatedList = new CompressedList<>(data);
updatedList.set(position, item);
@ -165,6 +175,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
return;
}
if (invalidated) {
Log.w(TAG, "Invalidated! Just before individual insert was loaded for position " + position);
return;
}
Data item = dataSource.load(key);
if (item == null) {
@ -172,6 +187,11 @@ class FixedSizePagingController<Key, Data> implements PagingController<Key> {
return;
}
if (invalidated) {
Log.w(TAG, "Invalidated! Just after individual insert was loaded for position " + position);
return;
}
List<Data> updatedList = new CompressedList<>(data);
updatedList.add(position, item);