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: Sending of message in empty MLS group #WPB-14747 🍒 #3177

Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Dec 13, 2024

BugWPB-14747 [Android] Sending of messages in EMPTY MLS groups not working with latest 4.10 build

This PR was automatically cherry-picked based on the following PR:

Original PR description:


What's new in this PR?

Issues

When user creates empty MLS group (self user is the only member) and has only 1 client. Then sending messages always fails in such a group.

Causes (Optional)

According to logs, send message error: InvalidRequestError(errorResponse=ErrorResponse(code=400, message=Application messages at epoch 0 are not supported, label=mls-protocol-error, cause=null)).
Why epoch = 0?

How it should work: when client creates MLS group epoch set 0, after that we suppose to add some users and when do that epoch is updated. But when the group is empty, no updating epoch.
There is "workaround" for that case calling updateKeyingMaterial(idMapper.toCryptoModel(groupID)) but it didn't work because of if(userIdList.isEmpty()) but it's always false, cause userIdList includes self userId.

Solutions

Update if in internalAddMemberToMLSGroup to check not userIds but clientKeyPackageList if empty.
In that case when client creates empty MLS group clientKeyPackageList will be empty and workaround works.

* fix: Sending of message in empty MLS group

* Fixed code style

* Fixed tests
Copy link
Contributor Author

github-actions bot commented Dec 16, 2024

Test Results

3 346 tests  ±0   3 239 ✅ ±0   5m 20s ⏱️ -44s
  573 suites ±0     107 💤 ±0 
  573 files   ±0       0 ❌ ±0 

Results for commit 9995ca1. ± Comparison against base commit 6fb2177.

♻️ This comment has been updated with latest results.

Copy link
Contributor Author

@borichellow borichellow added this pull request to the merge queue Dec 16, 2024
@datadog-wireapp
Copy link

Datadog Report

Branch report: fix/sending_of_messages_in_empty_mls_group-cherry-pick
Commit report: a54c7c1
Test service: kalium-jvm

✅ 0 Failed, 3239 Passed, 107 Skipped, 1m 1.64s Total Time

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 89.65517% with 3 lines in your changes missing coverage. Please review.

Project coverage is 54.13%. Comparing base (6fb2177) to head (9995ca1).

Files with missing lines Patch % Lines
...gic/data/conversation/MLSConversationRepository.kt 89.65% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3177      +/-   ##
===========================================
- Coverage    54.14%   54.13%   -0.01%     
===========================================
  Files         1252     1252              
  Lines        36527    36528       +1     
  Branches      3703     3703              
===========================================
  Hits         19776    19776              
- Misses       15326    15327       +1     
  Partials      1425     1425              
Files with missing lines Coverage Δ
...gic/data/conversation/MLSConversationRepository.kt 83.75% <89.65%> (+0.03%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fb2177...9995ca1. Read the comment docs.

Merged via the queue into develop with commit c7723ca Dec 16, 2024
23 checks passed
@borichellow borichellow deleted the fix/sending_of_messages_in_empty_mls_group-cherry-pick branch December 16, 2024 17:52
@echoes-hq echoes-hq bot added the echoes: unplanned/quick-win Work items completed to address issues quickly, without extensive planning. label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick PR is cherry-picking changes from another banch echoes: unplanned/quick-win Work items completed to address issues quickly, without extensive planning. 🚨 Potential breaking changes 👕 size: S type: bug / fix 🐞
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants