fix(sync): avoid invalid MLS reset state - #4301
Draft
MohamadJaara wants to merge 2 commits into
Draft
Conversation
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4301 +/- ##
==========================================
Coverage 61.30% 61.31%
Complexity 4022 4022
==========================================
Files 2163 2163
Lines 69467 69463 -4
Branches 6901 6900 -1
==========================================
- Hits 42590 42588 -2
+ Misses 24114 24112 -2
Partials 2763 2763
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Intent
Avoid persisting an incorrect MLS reset state when the new group cannot be inspected.
Root cause
The reset handler converted a failed established-group check to
false. That made an unavailable or failed check indistinguishable from a confirmed non-established group, so the conversation could be written asPENDING_AFTER_RESETeven though the real group state was unknown.The established-group path also read the epoch directly instead of using the repository's failure-aware wrapper.
Reproduction
MLSResetevent.false.Fix
The handler now stops the reset state transition when either the established-group check or the new-group epoch lookup fails. Epoch lookup uses the repository wrapper, and handling failures are logged inside the handler.
Leaving the old group remains best-effort because a replay may find it already absent. The receiver's existing acknowledgement behavior is unchanged; these failures are not newly propagated to its caller.
Regression coverage verifies that established-group and epoch lookup failures do not update the conversation state, while the established and pending success paths still do.