Fix reaction notification data inconsistencies.

Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
Cody Henthorne
2021-04-26 15:51:23 -04:00
parent 006eebb09e
commit c9d1fb8533
6 changed files with 82 additions and 4 deletions

View File

@@ -35,6 +35,8 @@ public class DeleteNotificationReceiver extends BroadcastReceiver {
if (ids == null || mms == null || ids.length != mms.length) return;
PendingResult finisher = goAsync();
SignalExecutors.BOUNDED.execute(() -> {
for (int i = 0; i < ids.length; i++) {
if (!mms[i]) {
@@ -43,6 +45,7 @@ public class DeleteNotificationReceiver extends BroadcastReceiver {
DatabaseFactory.getMmsDatabase(context).markAsNotified(ids[i]);
}
}
finisher.finish();
});
}
}

View File

@@ -49,6 +49,7 @@ public class MarkReadReceiver extends BroadcastReceiver {
NotificationCancellationHelper.cancelLegacy(context, intent.getIntExtra(NOTIFICATION_ID_EXTRA, -1));
PendingResult finisher = goAsync();
SignalExecutors.BOUNDED.execute(() -> {
List<MarkedMessageInfo> messageIdsCollection = new LinkedList<>();
@@ -61,6 +62,7 @@ public class MarkReadReceiver extends BroadcastReceiver {
process(context, messageIdsCollection);
ApplicationDependencies.getMessageNotifier().updateNotification(context);
finisher.finish();
});
}
}