Skip to content

fix: suppress buffer error for mls decrypt transaction [WPB-16233] 🍒 #3306

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

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 21, 2025

BugWPB-16233 [Android] Catch and suppress buffer errors inside transaction

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

Original PR description:



PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • When receiving out-of-order commits (e.g., when a client is missing a preceding commit), the MLS client was throwing a BufferedFutureMessage exception instead of buffering and persisting the message.
  • This led to transactions always rolling back and no buffered messages actually being saved.

Causes

  • The code did not properly detect or handle MlsException.BufferedFutureMessage (wrapped in CoreCryptoException.Mls) within the transactional decryption flow.
  • As a result, any out-of-order commit triggered a rollback, preventing buffering logic from persisting the messages that should be processed later.

Solutions

  • Updated the decryptMessage flow to wrap calls in a transactional API and specifically catch BufferedFutureMessage exceptions, allowing the transaction to commit and the message to be buffered rather than rolled back.
  • Added tests verifying that out-of-order commits no longer throw exceptions and that previously buffered commits are eventually flushed once the missing epoch is processed.

…3305)

* fix: suppress buffer error for mls decrypt transaction

* detekt fix

* error check fix

* detekt fix
@github-actions github-actions bot added cherry-pick PR is cherry-picking changes from another banch type: bug / fix 🐞 👕 size: M labels Feb 21, 2025
Copy link

Copy link
Contributor Author

github-actions bot commented Feb 25, 2025

Test Results

3 526 tests  +4   3 416 ✅ +2   6m 58s ⏱️ +7s
  603 suites ±0     110 💤 +2 
  603 files   ±0       0 ❌ ±0 

Results for commit bcfd49b. ± Comparison against base commit 0e9130f.

♻️ This comment has been updated with latest results.

Copy link
Contributor Author

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.70%. Comparing base (0e9130f) to head (bcfd49b).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3306      +/-   ##
===========================================
+ Coverage    50.69%   50.70%   +0.01%     
===========================================
  Files         1611     1611              
  Lines        58162    58174      +12     
  Branches      5249     5254       +5     
===========================================
+ Hits         29485    29500      +15     
+ Misses       26649    26642       -7     
- Partials      2028     2032       +4     

see 2 files 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 0e9130f...bcfd49b. Read the comment docs.

@datadog-wireapp
Copy link

Datadog Report

Branch report: fix/suppress-mls-buffer-error-cherry-pick
Commit report: 2937aa3
Test service: kalium-jvm

✅ 0 Failed, 3416 Passed, 110 Skipped, 1m 4.87s Total Time

@MohamadJaara MohamadJaara added this pull request to the merge queue Feb 25, 2025
Merged via the queue into develop with commit d63a931 Feb 25, 2025
22 checks passed
@MohamadJaara MohamadJaara deleted the fix/suppress-mls-buffer-error-cherry-pick branch February 25, 2025 08:57
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 👕 size: M type: bug / fix 🐞
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants