kopia lustrzana https://github.com/ryukoposting/Signal-Android
Protect against individual item updates being put into an invalidated list.
rodzic
1a9d785cbb
commit
ef7d5d55cb
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue