Send error message after cancelling a link+sync.

This commit is contained in:
Michelle Tang
2025-04-22 12:06:01 -04:00
committed by Cody Henthorne
parent 2bb94089f7
commit 9e89d688f1

View File

@@ -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(