Add debug info for archive upload progress.

This commit is contained in:
Greyson Parrelli
2025-08-11 10:49:36 -04:00
parent 3995608fd8
commit f518862dc3
2 changed files with 50 additions and 0 deletions

View File

@@ -76,6 +76,27 @@ class LogSectionRemoteBackups : LogSection {
output.append("None\n")
}
output.append("\n -- ArchiveUploadProgress\n")
if (SignalStore.backup.archiveUploadState != null) {
output.append("State: ${SignalStore.backup.archiveUploadState}\n")
output.append("Pending bytes: ${SignalDatabase.attachments.getPendingArchiveUploadBytes()}\n")
val pendingAttachments = SignalDatabase.attachments.debugGetPendingArchiveUploadAttachments()
if (pendingAttachments.isNotEmpty()) {
output.append("Pending attachments:\n")
output.append(" Count: ${pendingAttachments.size}\n")
output.append(" Sum of Size: ${pendingAttachments.sumOf { it.size }}\n")
output.append(" Content types:\n")
pendingAttachments.groupBy { it.contentType }.forEach { (contentType, attachments) ->
output.append(" $contentType: ${attachments.size}\n")
}
} else {
output.append("Pending attachments: None!\n")
}
} else {
output.append("None\n")
}
return output
}
}