Skip to content

Commit

Permalink
Merge branch 'release/candidate' into fix/missing_mls_conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods authored Mar 11, 2024
2 parents 2cdaa97 + 6f2869d commit 066b05c
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ data class WireIdentity(
val status: CryptoCertificateStatus,
val thumbprint: String,
val serialNumber: String,
val endTimestamp: Long
val endTimestampSeconds: Long
)

enum class CryptoCertificateStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ internal class MLSConversationDataSource(
}

override suspend fun requestToJoinGroup(groupID: GroupID, epoch: ULong): Either<CoreFailure, Unit> {
kaliumLogger.d("Requesting to re-join MLS group $groupID with epoch $epoch")
kaliumLogger.d("Requesting to re-join MLS group ${groupID.toLogString()} with epoch $epoch")
return mlsClientProvider.getMLSClient().flatMap { mlsClient ->
wrapMLSRequest {
mlsClient.joinConversation(idMapper.toCryptoModel(groupID), epoch)
Expand All @@ -301,7 +301,7 @@ internal class MLSConversationDataSource(
groupID: GroupID,
groupInfo: ByteArray
): Either<CoreFailure, Unit> = withContext(serialDispatcher) {
kaliumLogger.d("Requesting to re-join MLS group $groupID via external commit")
kaliumLogger.d("Requesting to re-join MLS group ${groupID.toLogString()} via external commit")
mlsClientProvider.getMLSClient().flatMap { mlsClient ->
wrapMLSRequest {
mlsClient.joinByExternalCommit(groupInfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ data class E2eiCertificate(
status = certificateStatusMapper.toCertificateStatus(identity.status),
serialNumber = identity.serialNumber,
certificateDetail = identity.certificate,
endAt = Instant.fromEpochMilliseconds(identity.endTimestamp)
endAt = Instant.fromEpochSeconds(identity.endTimestampSeconds)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MLSMessageCreatorImpl(

override suspend fun createOutgoingMLSMessage(groupId: GroupID, message: Message.Sendable): Either<CoreFailure, MLSMessageApi.Message> {
return mlsClientProvider.getMLSClient().flatMap { mlsClient ->
kaliumLogger.i("Creating outgoing MLS message (groupID = $groupId)")
kaliumLogger.i("Creating outgoing MLS message (groupID = ${groupId.toLogString()})")

val expectsReadConfirmation = when (message) {
is Message.Regular -> message.expectsReadConfirmation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ internal class PendingProposalSchedulerImpl(
private suspend fun startCommittingPendingProposals() {
kaliumLogger.d("Start listening for pending proposals to commit")
timers().cancellable().collect() { groupID ->
kaliumLogger.d("Committing pending proposals in $groupID")
kaliumLogger.d("Committing pending proposals in ${groupID.toLogString()}")
mlsConversationRepository.value.commitPendingProposals(groupID)
.onFailure {
kaliumLogger.e("Failed to commit pending proposals in $groupID: $it")
kaliumLogger.e("Failed to commit pending proposals in ${groupID.toLogString()}: $it")
}
}
}
Expand All @@ -120,7 +120,7 @@ internal class PendingProposalSchedulerImpl(
}

override suspend fun scheduleCommit(groupID: GroupID, date: Instant) {
kaliumLogger.d("Scheduling to commit pending proposals in $groupID at $date")
kaliumLogger.d("Scheduling to commit pending proposals in ${groupID.toLogString()} at $date")
mlsConversationRepository.value.setProposalTimer(
ProposalTimer(groupID, date),
inMemory = subconversationRepository.value.containsSubconversation(groupID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.yield
import kotlinx.datetime.Instant
import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals
import kotlin.test.assertIs

Expand Down Expand Up @@ -1891,7 +1890,7 @@ class MLSConversationRepositoryTest {
CryptoCertificateStatus.VALID,
thumbprint = "thumbprint",
serialNumber = "serialNumber",
endTimestamp = 1899105093
endTimestampSeconds = 1899105093
)
val E2EI_CONVERSATION_CLIENT_INFO_ENTITY =
E2EIConversationClientInfoEntity(UserIDEntity(uuid4().toString(), "domain.com"), "clientId", "groupId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class MLSConversationsVerificationStatusesHandlerTest {
serialNumber = "serial1",
status = CryptoCertificateStatus.VALID,
thumbprint = "thumbprint1",
endTimestamp = 0L
endTimestampSeconds = 0L
)
),
user2.first.toModel() to listOf(
Expand All @@ -200,7 +200,7 @@ class MLSConversationsVerificationStatusesHandlerTest {
serialNumber = "serial2",
status = CryptoCertificateStatus.VALID,
thumbprint = "thumbprint2",
endTimestamp = 0L
endTimestampSeconds = 0L
)
)
)
Expand Down Expand Up @@ -256,7 +256,7 @@ class MLSConversationsVerificationStatusesHandlerTest {
serialNumber = "serial1",
status = CryptoCertificateStatus.VALID,
thumbprint = "thumbprint1",
endTimestamp = 0L
endTimestampSeconds = 0L
)
),
user2.first.toModel() to listOf(
Expand All @@ -272,7 +272,7 @@ class MLSConversationsVerificationStatusesHandlerTest {
serialNumber = "serial2",
status = CryptoCertificateStatus.VALID,
thumbprint = "thumbprint2",
endTimestamp = 0L
endTimestampSeconds = 0L
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class GetE2eiCertificateUseCaseTest {
status = CryptoCertificateStatus.EXPIRED,
thumbprint = "thumbprint",
serialNumber = "serialNumber",
endTimestamp = 1899105093
endTimestampSeconds = 1899105093
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class GetMembersE2EICertificateStatusesUseCaseTest {
CryptoCertificateStatus.VALID,
"thumbprint",
"serialNumber",
endTimestamp = 1899105093
endTimestampSeconds = 1899105093
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class GetUserE2eiAllCertificateStatusesUseCaseTest {
CryptoCertificateStatus.VALID,
"thumbprint",
serialNumber = "serialNumber",
endTimestamp = 1899105093
endTimestampSeconds = 1899105093
)
}
}

0 comments on commit 066b05c

Please sign in to comment.