Skip to content

refactor: establish MLS groups with one single transaction [WPB-23744]#20521

Merged
thisisamir98 merged 12 commits intodevfrom
WPB-23744
Mar 2, 2026
Merged

refactor: establish MLS groups with one single transaction [WPB-23744]#20521
thisisamir98 merged 12 commits intodevfrom
WPB-23744

Conversation

@thisisamir98
Copy link
Copy Markdown
Collaborator

@thisisamir98 thisisamir98 commented Feb 27, 2026

TaskWPB-23744 [Web] Utilize Core Crypto Transactions API for Full MLS Establish/Join Flow

Problem statement

We identified race conditions during MLS establish/reset flows.
If multiple clients try to establish or reset the same group concurrently, only one “wins” the race. Others may end up in a broken epoch 0 state.

Currently, the flow is split across multiple transactions:

  1. Register conversation on Core Crypto
  2. Download key packages
  3. Establish MLS group

This allows partial state to persist if a failure or race occurs.

Solution

Refactor the Web MLS establish flow to run fully inside a single Core Crypto transaction.

  • Ensure atomic establish/join
  • Automatically rollback if:
    • Client loses the race
    • A Welcome arrives mid-establish
    • Any step fails
  • Prevent broken or partial MLS state

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 46.87500% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.47%. Comparing base (88864c7) to head (ed7ed11).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...rc/messagingProtocols/mls/MLSService/MLSService.ts 50.00% 15 Missing ⚠️
...rsation/ConversationService/ConversationService.ts 0.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (46.87%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #20521      +/-   ##
==========================================
- Coverage   45.47%   45.47%   -0.01%     
==========================================
  Files        1639     1639              
  Lines       40402    40411       +9     
  Branches     8345     8346       +1     
==========================================
+ Hits        18371    18375       +4     
- Misses      20095    20100       +5     
  Partials     1936     1936              
Flag Coverage Δ
app_webapp 43.68% <ø> (ø)
lib_api_client 50.17% <ø> (ø)
lib_core 59.01% <46.87%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...gProtocols/mls/recovery/MlsRecoveryOrchestrator.ts 80.64% <ø> (ø)
...rsation/ConversationService/ConversationService.ts 62.50% <0.00%> (-0.45%) ⬇️
...rc/messagingProtocols/mls/MLSService/MLSService.ts 48.20% <50.00%> (+0.17%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread libraries/core/src/messagingProtocols/mls/MLSService/MLSService.ts Outdated
Comment thread libraries/core/src/messagingProtocols/mls/MLSService/MLSService.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 27, 2026

🔗 Download Full Report Artifact

🧪 Playwright Test Summary

  • Passed: 10
  • Failed: 0
  • Skipped: 3
  • 🔁 Flaky: 1
  • 📊 Total: 14
  • Total Runtime: 92.4s (~ 1 min 32 sec)
specs/CriticalFlow/backupRestoration-TC-8634.spec.ts (❌ 0 failed, ⚠️ 1 flaky)
  • ⚠️ Setting up new device with a backup (tags: TC-8634, crit-flow-web)

screendriver
screendriver previously approved these changes Mar 2, 2026
@thisisamir98 thisisamir98 enabled auto-merge March 2, 2026 13:24
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 2, 2026

@thisisamir98 thisisamir98 added this pull request to the merge queue Mar 2, 2026
Merged via the queue into dev with commit b3ab919 Mar 2, 2026
53 checks passed
@thisisamir98 thisisamir98 deleted the WPB-23744 branch March 2, 2026 13:33
screendriver pushed a commit that referenced this pull request Mar 4, 2026
#20521)

* adds new operation name for establishing mls groups

* Adds policy entries for establishGroup

* adds new tests for establish group operation

* executes group establishment method through mls recovery orchestrator

* uses passed transaction context instead of creating it's own transaction

* uses passed transaction context instead of creating it's own transaction

* establishes MLS groups with one single transaction

* avoids fetching mls public keys inside transaction

* avoids fetching keypackages inside transaction

* update key material using parent transaction context

* adds tests
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.

3 participants