mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 09:47:58 +01:00
Add a method to check for the presence of persisted messages, skipping the cache
This commit is contained in:
committed by
Jon Chambers
parent
f1c153f39f
commit
822092044b
@@ -64,8 +64,8 @@ public class NotifyIdleDevicesWithoutMessagesPushNotificationExperiment implemen
|
||||
return CompletableFuture.completedFuture(false);
|
||||
}
|
||||
|
||||
return messagesManager.mayHaveMessages(account.getIdentifier(IdentityType.ACI), device)
|
||||
.thenApply(mayHaveMessages -> !mayHaveMessages);
|
||||
return messagesManager.mayHavePersistedMessages(account.getIdentifier(IdentityType.ACI), device)
|
||||
.thenApply(mayHavePersistedMessages -> !mayHavePersistedMessages);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
@@ -67,6 +67,10 @@ public class MessagesManager {
|
||||
}
|
||||
}
|
||||
|
||||
public CompletableFuture<Boolean> mayHavePersistedMessages(final UUID destinationUuid, final Device destinationDevice) {
|
||||
return messagesDynamoDb.mayHaveMessages(destinationUuid, destinationDevice);
|
||||
}
|
||||
|
||||
public CompletableFuture<Boolean> mayHaveMessages(final UUID destinationUuid, final Device destinationDevice) {
|
||||
return messagesCache.hasMessagesAsync(destinationUuid, destinationDevice.getId())
|
||||
.thenCombine(messagesDynamoDb.mayHaveMessages(destinationUuid, destinationDevice),
|
||||
|
||||
Reference in New Issue
Block a user