Exclude disappearing attachments from archive size estimation.

This commit is contained in:
Cody Henthorne
2025-07-18 15:57:35 -04:00
committed by GitHub
parent eae0b43858
commit e0df5e6df0
2 changed files with 14 additions and 5 deletions

View File

@@ -132,6 +132,10 @@ class ChatItemArchiveExporter(
private val cursorGenerator: (Long, Int) -> Cursor
) : Iterator<ChatItem?>, Closeable {
companion object {
val EXPIRATION_CUTOFF = 1.days
}
/** Timer for more macro-level events, like fetching extra data vs transforming the data. */
private val eventTimer = EventTimer()
@@ -567,7 +571,7 @@ private fun BackupMessageRecord.toBasicChatItemBuilder(selfRecipientId: Recipien
}
if (!MessageTypes.isExpirationTimerUpdate(record.type) && builder.expiresInMs != null && builder.expireStartDate != null) {
val cutoffDuration = 1.days.inWholeMilliseconds
val cutoffDuration = ChatItemArchiveExporter.EXPIRATION_CUTOFF.inWholeMilliseconds
val expiresAt = builder.expireStartDate!! + builder.expiresInMs!!
val threshold = if (exportState.forTransfer) backupStartTime else backupStartTime + cutoffDuration