Skip to content

Commit

Permalink
fix(mls-migration): allow skipping users without KeyPackages during M…
Browse files Browse the repository at this point in the history
…LS migration (WPB-9638) πŸ’ πŸ’ (#2860)

* fix(mls-migration): allow skipping users without KeyPackages during MLS migration (WPB-9638) πŸ’ (#2852)

* fix(mls-migration): allow skipping users without KeyPackages during MLS migration (WPB-9638) (#2845)

* fix(mls-migration): allow skipping users without KeyPackages during mls migration

* change logs to debug level instead of warning

* trigger CI

---------

Co-authored-by: Mojtaba Chenani <[email protected]>

* trigger CI

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mojtaba Chenani <[email protected]>
  • Loading branch information
github-actions[bot] and mchenani authored Jul 2, 2024
1 parent 485bd10 commit c01866c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,17 @@ internal class MLSConversationDataSource(
allowPartialMemberList: Boolean = false,
): Either<CoreFailure, MLSAdditionResult> = withContext(serialDispatcher) {
commitPendingProposals(groupID).flatMap {
kaliumLogger.d("adding $userIdList to MLS group: $groupID")
kaliumLogger.d("adding ${userIdList.count()} users to MLS group")
produceAndSendCommitWithRetryAndResult(groupID, retryOnStaleMessage = retryOnStaleMessage) {
keyPackageRepository.claimKeyPackages(userIdList, cipherSuite).flatMap { result ->
if (result.usersWithoutKeyPackagesAvailable.isNotEmpty() && !allowPartialMemberList) {
kaliumLogger.d(
"add members to MLS Group: failed " +
"${result.usersWithoutKeyPackagesAvailable.count()} user(s) missing KeyPackages"
)
Either.Left(CoreFailure.MissingKeyPackages(result.usersWithoutKeyPackagesAvailable))
} else {
kaliumLogger.d("add members to MLS Group: claiming KeyPackages succeed")
Either.Right(result)
}
}.flatMap { result ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ internal class MLSMigratorImpl(
when (protocolInfo) {
is Conversation.ProtocolInfo.Mixed -> {
conversationRepository.getConversationMembers(conversationId).flatMap { members ->
mlsConversationRepository.establishMLSGroup(protocolInfo.groupId, members)
mlsConversationRepository.establishMLSGroup(
protocolInfo.groupId,
members,
allowSkippingUsersWithoutKeyPackages = true
)
}
Unit.right()
}
Expand Down

0 comments on commit c01866c

Please sign in to comment.