From fde0f3bba1e9afb4a4ec49e08f7779d92fe985c6 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Mon, 25 Sep 2023 15:00:35 -0300 Subject: [PATCH] Fix call log clear history error handling. --- .../thoughtcrime/securesms/calls/log/CallLogRepository.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/calls/log/CallLogRepository.kt b/app/src/main/java/org/thoughtcrime/securesms/calls/log/CallLogRepository.kt index 5824ab3430..3fc4adcf44 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/calls/log/CallLogRepository.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/calls/log/CallLogRepository.kt @@ -86,6 +86,10 @@ class CallLogRepository( /** * Delete all call events / unowned links and enqueue clear history job, and then * emit a clear history message. + * + * This explicitly drops failed call link revocations of call links, and those call links + * will remain visible to the user. This is safe because the clear history sync message should + * only clear local history and then poll link status from the server. */ fun deleteAllCallLogsOnOrBeforeNow(): Single { return Single.fromCallable { @@ -97,7 +101,7 @@ class CallLogRepository( } SignalDatabase.callLinks.getAllAdminCallLinksExcept(emptySet()) - }.flatMap(this::revokeAndCollectResults).map { -1 }.subscribeOn(Schedulers.io()) + }.flatMap(this::revokeAndCollectResults).map { 0 }.subscribeOn(Schedulers.io()) } /**