Skip to content

Commit

Permalink
Rotate KeyPackage after processing Welcomes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bren2010 committed Mar 11, 2024
1 parent 114d132 commit 8345016
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions xmtp_mls/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@ where
})
.collect();

if groups.len() > 0 {
if let Err(err) = self.rotate_key_package().await {
log::error!("Error rotating key package: {:?}", err);
}
}

Ok(groups)
}

Expand Down
7 changes: 6 additions & 1 deletion xmtp_mls/src/subscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ where
})
.filter_map(|res| async {
match res.await {
Ok(group) => Some(group),
Ok(group) => {
if let Err(err) = self.rotate_key_package().await {
log::error!("Error rotating key package: {:?}", err);
}
Some(group)
},
Err(err) => {
log::error!("Error processing stream entry: {:?}", err);
None
Expand Down

0 comments on commit 8345016

Please sign in to comment.