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 #3176

Merged

Conversation

borichellow
Copy link
Contributor

@borichellow borichellow commented Dec 13, 2024

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

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.

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Test Results

3 340 tests  ±0   3 233 ✅ ±0   5m 52s ⏱️ +12s
  572 suites ±0     107 💤 ±0 
  572 files   ±0       0 ❌ ±0 

Results for commit 170c532. ± Comparison against base commit 6518915.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Dec 13, 2024

Datadog Report

Branch report: fix/sending_of_messages_in_empty_mls_group
Commit report: 788e969
Test service: kalium-jvm

✅ 0 Failed, 3233 Passed, 107 Skipped, 1m 2.4s Total Time

@yamilmedina yamilmedina added this pull request to the merge queue Dec 13, 2024
@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.14%. Comparing base (6518915) to head (170c532).

Files with missing lines Patch % Lines
...gic/data/conversation/MLSConversationRepository.kt 89.65% 3 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           release/candidate    #3176      +/-   ##
=====================================================
- Coverage              54.14%   54.14%   -0.01%     
=====================================================
  Files                   1250     1250              
  Lines                  36457    36458       +1     
  Branches                3689     3689              
=====================================================
  Hits                   19739    19739              
- Misses                 15294    15295       +1     
  Partials                1424     1424              
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 6518915...170c532. Read the comment docs.

Merged via the queue into release/candidate with commit 4b88fac Dec 13, 2024
21 checks passed
@yamilmedina yamilmedina deleted the fix/sending_of_messages_in_empty_mls_group branch December 13, 2024 16:29
github-actions bot pushed a commit that referenced this pull request Dec 13, 2024
* fix: Sending of message in empty MLS group

* Fixed code style

* Fixed tests
github-merge-queue bot pushed a commit that referenced this pull request Dec 16, 2024
* fix: Sending of message in empty MLS group

* Fixed code style

* Fixed tests

Co-authored-by: boris <[email protected]>
Co-authored-by: Yamil Medina <[email protected]>
@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
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