mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 12:08:34 +00:00
Protect against individual item updates being put into an invalidated list.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user