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: suppress buffer error for mls decrypt transaction [WPB-16233] 🍒 #3306

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

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

Original PR description:


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


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
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.

1 participant