Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,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
Loading