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

Make CommitProcessor another variant of ReceivedMessage. #241

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

mulmarta
Copy link
Contributor

let ReceivedMessage::CommitProcessor(processor) = group.process_incoming_message(msg)? else {...}

let ReceivedMessage::Commit(commit) = group.process_incoming_message_oneshot(msg)? else {...}

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.

@mulmarta mulmarta requested a review from a team as a code owner January 16, 2025 13:37
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 82.66667% with 26 lines in your changes missing coverage. Please review.

Project coverage is 90.30%. Comparing base (1c124a0) to head (59ceef7).

Files with missing lines Patch % Lines
mls-rs/src/group/test_utils.rs 50.00% 17 Missing ⚠️
mls-rs/src/group/message_processor.rs 71.87% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           1.x-main     #241      +/-   ##
============================================
- Coverage     90.34%   90.30%   -0.04%     
============================================
  Files           177      177              
  Lines         31318    31365      +47     
============================================
+ Hits          28294    28325      +31     
- Misses         3024     3040      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

#[allow(clippy::large_enum_variant)]
pub enum ExternalReceivedMessage {
/// State update as the result of a successful commit.
pub enum ExternalReceivedMessage<'a, C: ExternalClientConfig> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just food for thought, the 'a nature of this might get in the way of passing this around or storing it places. Maybe it makes more sense for the oneshot function to return simply ExternalReceivedMessage, and the non-oneshot function to return an enum that is either ExternalReceivedMessage or CommitProcessor

Comment on lines 225 to 230
ReceivedMessage::Commit(value) => f.write_str(&format!("Commit({value:?})")),
ReceivedMessage::Proposal(value) => f.write_str(&format!("Proposal({value:?})")),
ReceivedMessage::GroupInfo(value) => f.write_str(&format!("GroupInfo({value:?})")),
ReceivedMessage::KeyPackage(value) => f.write_str(&format!("KeyPackage({value:?})")),
ReceivedMessage::Welcome => f.write_str("Welcome"),
ReceivedMessage::CommitProcessor(_) => f.write_str("CommitProcessor"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above for this, might simplify a bit

@mulmarta mulmarta merged commit 51d8542 into 1.x-main Jan 17, 2025
28 of 30 checks passed
@mulmarta mulmarta deleted the 1.x-processor branch January 17, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants