Code review

This commit is contained in:
Benoit Marty 2021-07-21 14:06:47 +02:00
parent ab6e0767bb
commit 4ead39038c
2 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,9 @@ internal class DefaultSendToDeviceTask @Inject constructor(
messages = params.contentMap.map messages = params.contentMap.map
) )
// Create a unique txnId first, to use the same value if the request is retried // If params.transactionId is not provided, we create a unique txnId.
// It's important to do that outside the requestBlock parameter of executeRequest()
// to use the same value if the request is retried
val txnId = params.transactionId ?: createUniqueTxnId() val txnId = params.transactionId ?: createUniqueTxnId()
return executeRequest( return executeRequest(

View File

@ -19,5 +19,5 @@ package org.matrix.android.sdk.internal.crypto.util
import java.util.UUID import java.util.UUID
internal object RequestIdHelper { internal object RequestIdHelper {
fun createUniqueRequestId() = "req_" + UUID.randomUUID().toString() fun createUniqueRequestId() = UUID.randomUUID().toString()
} }