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

Repro missing epochs #33

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions openmls/src/group/core_group/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ impl CoreGroup {
if let Some(message_secrets) = self.merge_commit(provider, staged_commit)? {
self.message_secrets_store
.add(past_epoch, message_secrets, leaves);
provider
.storage()
.write_message_secrets(self.group_id(), &self.message_secrets_store)
.map_err(|err| MergeCommitError::StorageError(err))?;
}
// Empty the proposal store
proposal_store.empty();
Expand Down
6 changes: 4 additions & 2 deletions openmls/src/group/tests/test_past_secrets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
framing::{MessageDecryptionError, MlsMessageIn, ProcessedMessageContent},
group::*,
};
use openmls_traits::OpenMlsProvider;

#[openmls_test::openmls_test]
fn test_past_secrets_in_group(
Expand Down Expand Up @@ -122,7 +123,6 @@ fn test_past_secrets_in_group(
}

// === Test application messages from older epochs ===

// The first messages should fail
for application_message in application_messages.iter().take(max_epochs / 2) {
let err = bob_group
Expand All @@ -135,7 +135,9 @@ fn test_past_secrets_in_group(
),)
));
}

let mut bob_group = MlsGroup::load(provider.storage(), bob_group.group_id())
.expect("reload group")
.unwrap();
// The last messages should not fail
for application_message in application_messages.iter().skip(max_epochs / 2) {
let bob_processed_message = bob_group
Expand Down
Loading