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: Wrong E2EI information for other users [WPB-9409] 🍒 #2835

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 24, 2024

BugWPB-9409 [Android] Wrong e2ei information for other users after self user is kicked out of the group

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

Original PR description:


What's new in this PR?

Issues

Wrong e2ei information for other users after self user is kicked out of the group:

  • enable MLS for team on bund-next env
  • login with user A, B and C
  • create an MLS group with all 3 users
  • create a 1:1 between A and C
  • enable e2ei for all the users
  • generate cert for A and B
  • delay generating the cert for C
  • remove user C from the group conversation
  • now take a look as user C at the 1:1 conversation with user A > details > devices

Result:
device for user A does not have cert information

Causes (Optional)

To get Identities for each device of user we need to get Id of MLS group this users belongs to.
To get MLS group kalium finds the conversation that this user belongs to and get MLSGroupId from it.

The problem comes out when self user is removed from some group-conversation and when kalium is looking for conversation OtherUser belongs to, finds exactly that group-conversation (it happens not in 100% of cases as there are couple of such conversations in DB, but LIMIT 1 in query is used). So kalium uses MLSGroupId of the conversation SelfUser doesn't belongs to => doesn't have access to MLS group => no Identities found for OtherUser.

Solutions

Update DB-query to get MLSGpoupId of conversation that both (SelfUser and OtherUser) belongs to.

* fix: Wrong E2EI information for other users

* Added tests
@borichellow borichellow requested review from a team, yamilmedina, mchenani, Garzas and saleniuk and removed request for a team June 24, 2024 12:23
Copy link
Contributor Author

github-actions bot commented Jun 25, 2024

Test Results

3 064 tests   2 959 ✔️  3m 22s ⏱️
   530 suites     105 💤
   530 files           0

Results for commit 15d8fbe.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Jun 25, 2024

Datadog Report

Branch report: fix/wrong_e2ei_information_for_other_users-cherry-pick
Commit report: 5f97c3b
Test service: kalium-jvm

✅ 0 Failed, 2956 Passed, 105 Skipped, 14.98s Total Time

@vitorhugods vitorhugods enabled auto-merge (squash) June 28, 2024 14:47
Copy link

sonarcloud bot commented Jul 2, 2024

@vitorhugods vitorhugods merged commit e176d92 into release/candidate Jul 2, 2024
19 checks passed
@vitorhugods vitorhugods deleted the fix/wrong_e2ei_information_for_other_users-cherry-pick branch July 2, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants