diff --git a/openmls/src/group/core_group/process.rs b/openmls/src/group/core_group/process.rs index e203643af..377695248 100644 --- a/openmls/src/group/core_group/process.rs +++ b/openmls/src/group/core_group/process.rs @@ -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(); diff --git a/openmls/src/group/tests/test_past_secrets.rs b/openmls/src/group/tests/test_past_secrets.rs index f065919d8..ecfbf15de 100644 --- a/openmls/src/group/tests/test_past_secrets.rs +++ b/openmls/src/group/tests/test_past_secrets.rs @@ -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( @@ -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 @@ -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