From 9e89d688f186152413f2fcac1fc416ee41fa13b4 Mon Sep 17 00:00:00 2001 From: Michelle Tang Date: Tue, 22 Apr 2025 12:06:01 -0400 Subject: [PATCH] Send error message after cancelling a link+sync. --- .../securesms/linkdevice/LinkDeviceRepository.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/linkdevice/LinkDeviceRepository.kt b/app/src/main/java/org/thoughtcrime/securesms/linkdevice/LinkDeviceRepository.kt index 9474a303d8..77ad74606c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/linkdevice/LinkDeviceRepository.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/linkdevice/LinkDeviceRepository.kt @@ -270,6 +270,7 @@ object LinkDeviceRepository { if (cancellationSignal()) { Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.") + sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED) return LinkUploadArchiveResult.BackupCreationCancelled } @@ -294,6 +295,7 @@ object LinkDeviceRepository { if (cancellationSignal()) { Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.") + sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED) return LinkUploadArchiveResult.BackupCreationCancelled } @@ -307,6 +309,7 @@ object LinkDeviceRepository { if (cancellationSignal()) { Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.") + sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED) return LinkUploadArchiveResult.BackupCreationCancelled } @@ -320,6 +323,7 @@ object LinkDeviceRepository { if (cancellationSignal()) { Log.i(TAG, "[createAndUploadArchive] Backup was cancelled.") + sendTransferArchiveError(deviceId, deviceCreatedAt, TransferArchiveError.RELINK_REQUESTED) return LinkUploadArchiveResult.BackupCreationCancelled } @@ -383,7 +387,7 @@ object LinkDeviceRepository { } /** - * If [createAndUploadArchive] fails to upload an archive, alert the linked device of the failure and if the user will try again + * If [createAndUploadArchive] is cancelled or fails to upload an archive, alert the linked device of the failure and if the user will try again */ fun sendTransferArchiveError(deviceId: Int, deviceCreatedAt: Long, error: TransferArchiveError) { val archiveErrorResult = SignalNetwork.linkDevice.setTransferArchiveError(