Fix issue where delivery receipts may not update the thread summary.

We were notifying in a transaction, which we can't do anymore since
transactions don't block reads from other threads (meaning we could
notify and someone could read it before we end the transaction, so they
wouldn't see the update).
fork-5.53.8
Greyson Parrelli 2021-10-26 09:10:56 -04:00
rodzic dd7652ad44
commit ba0befde20
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -469,7 +469,7 @@ public class MmsSmsDatabase extends Database {
}
for (ThreadUpdate update : threadUpdates) {
threadDatabase.update(update.getThreadId(), false);
threadDatabase.updateSilently(update.getThreadId(), false);
}
db.setTransactionSuccessful();
@ -483,6 +483,10 @@ public class MmsSmsDatabase extends Database {
notifyConversationListeners(threadUpdate.getThreadId());
}
}
if (threadUpdates.size() > 0) {
notifyConversationListListeners();
}
}
return unhandled;

Wyświetl plik

@ -521,7 +521,7 @@ public class SmsDatabase extends MessageDatabase {
}
}
if (threadUpdates.size() > 0 && receiptType == ReceiptType.DELIVERY) {
if (threadUpdates.isEmpty() && receiptType == ReceiptType.DELIVERY) {
earlyDeliveryReceiptCache.increment(messageId.getTimetamp(), messageId.getRecipientId(), timestamp);
}