Improve reconciliation task to reduce possible churn.

This commit is contained in:
Greyson Parrelli
2025-07-15 14:30:05 -04:00
committed by Jeffrey Starke
parent cfa96f4737
commit 4b75b9f1d6
5 changed files with 64 additions and 18 deletions

View File

@@ -204,7 +204,7 @@ class AttachmentTableTest {
// Reset the transfer state by plaintextHash+remoteKey
val plaintextHash = SignalDatabase.attachments.getAttachment(attachmentId)!!.dataHash!!.decodeBase64OrThrow()
val remoteKey = SignalDatabase.attachments.getAttachment(attachmentId)!!.remoteKey!!.decodeBase64OrThrow()
SignalDatabase.attachments.resetArchiveTransferStateByPlaintextHashAndRemoteKey(plaintextHash, remoteKey)
SignalDatabase.attachments.resetArchiveTransferStateByPlaintextHashAndRemoteKeyIfNecessary(plaintextHash, remoteKey)
// Verify it's been reset
assertThat(SignalDatabase.attachments.getAttachment(attachmentId)!!.archiveTransferState).isEqualTo(AttachmentTable.ArchiveTransferState.NONE)