diff --git a/xmtp_mls/src/client.rs b/xmtp_mls/src/client.rs index 8c91dda0f..7ee4bf913 100644 --- a/xmtp_mls/src/client.rs +++ b/xmtp_mls/src/client.rs @@ -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) } diff --git a/xmtp_mls/src/subscriptions.rs b/xmtp_mls/src/subscriptions.rs index cfad9a7cb..1dec8c7e0 100644 --- a/xmtp_mls/src/subscriptions.rs +++ b/xmtp_mls/src/subscriptions.rs @@ -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