From c359be1355a32ae6742f8c27ed05b92d89e69f45 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Thu, 16 May 2024 12:06:40 -0700 Subject: [PATCH] write to storage on update --- openmls/src/group/errors.rs | 2 ++ openmls/src/group/mls_group/proposal.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/openmls/src/group/errors.rs b/openmls/src/group/errors.rs index 50e2e8317..5813434c2 100644 --- a/openmls/src/group/errors.rs +++ b/openmls/src/group/errors.rs @@ -519,6 +519,8 @@ pub enum CreateGroupContextExtProposalError { /// See [`CreateCommitError`] for more details. #[error(transparent)] CreateCommitError(#[from] CreateCommitError), + #[error("Error writing updated group data to storage.")] + StorageError(StorageError), } /// Error merging a commit. diff --git a/openmls/src/group/mls_group/proposal.rs b/openmls/src/group/mls_group/proposal.rs index b76a46bd3..be6df8e93 100644 --- a/openmls/src/group/mls_group/proposal.rs +++ b/openmls/src/group/mls_group/proposal.rs @@ -420,6 +420,11 @@ impl MlsGroup { create_commit_result.staged_commit, ))); + provider + .storage() + .write_group_state(self.group_id(), &self.group_state) + .map_err(CreateGroupContextExtProposalError::StorageError)?; + Ok(( mls_messages, create_commit_result