Address validation error around calls with invalid ringers.

This commit is contained in:
Greyson Parrelli
2025-10-28 10:35:59 -04:00
committed by jeffrey-signal
parent dcbd4a3fc4
commit 3c27a690fd
3 changed files with 7 additions and 2 deletions

View File

@@ -127,6 +127,10 @@ object ExportSkips {
return log(sentTimestamp, "A chat update that only makes sense for individual chats was found in a different kind of chat.")
}
fun callWithMissingRecipient(sentTimestamp: Long): String {
return log(sentTimestamp, "A call had a ringer with no matching exported Recipient.")
}
private fun log(sentTimestamp: Long, message: String): String {
return "[SKIP][$sentTimestamp] $message"
}

View File

@@ -747,7 +747,7 @@ private fun CallTable.Call.toRemoteCallUpdate(exportState: ExportState, messageR
CallTable.Event.OUTGOING_RING -> GroupCall.State.OUTGOING_RING
CallTable.Event.DELETE -> return null
},
ringerRecipientId = this.ringerRecipient?.toLong(),
ringerRecipientId = this.ringerRecipient?.toLong()?.takeIf { exportState.recipientIdToAci[it] != null },
startedCallRecipientId = groupCallUpdateDetails.startedCallUuid.takeIf { it.isNotEmpty() }?.let { exportState.aciToRecipientId[it] },
startedCallTimestamp = this.timestamp.clampToValidBackupRange(),
endedCallTimestamp = groupCallUpdateDetails.endedCallTimestamp.clampToValidBackupRange().takeIf { it > 0 },

View File

@@ -6,6 +6,7 @@
package org.thoughtcrime.securesms.backup.v2.processor
import org.signal.core.util.logging.Log
import org.thoughtcrime.securesms.backup.v2.ExportSkips
import org.thoughtcrime.securesms.backup.v2.ExportState
import org.thoughtcrime.securesms.backup.v2.ImportState
import org.thoughtcrime.securesms.backup.v2.database.getAdhocCallsForBackup
@@ -28,7 +29,7 @@ object AdHocCallArchiveProcessor {
if (exportState.recipientIds.contains(callLog.recipientId)) {
emitter.emit(Frame(adHocCall = callLog))
} else {
Log.w(TAG, "Dropping adhoc call for non-exported recipient.")
Log.w(TAG, ExportSkips.callWithMissingRecipient(callLog.callTimestamp))
}
}
}