Calculate remote backup media quota usage locally.

This commit is contained in:
Cody Henthorne
2025-06-06 10:47:32 -04:00
committed by Greyson Parrelli
parent efa9dd6ec3
commit 882a11c420
12 changed files with 119 additions and 37 deletions

View File

@@ -1045,14 +1045,6 @@ object BackupRepository {
}
}
fun getRemoteBackupUsedSpace(): NetworkResult<Long?> {
return initBackupAndFetchAuth()
.then { credential ->
SignalNetwork.archive.getBackupInfo(SignalStore.account.requireAci(), credential.mediaBackupAccess)
.map { it.usedSpace }
}
}
/**
* If backups are enabled, sync with the network. Otherwise, return a 404.
* Used in instrumentation tests.
@@ -1433,7 +1425,6 @@ object BackupRepository {
return initBackupAndFetchAuth()
.then { credential ->
SignalNetwork.archive.getBackupInfo(SignalStore.account.requireAci(), credential.mediaBackupAccess).map {
SignalStore.backup.usedBackupMediaSpace = it.usedSpace ?: 0L
"${it.backupDir!!.urlEncode()}/${it.mediaDir!!.urlEncode()}"
}
}