mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
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).
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user