diff --git a/crates/matrix-sdk/src/encryption/backups/mod.rs b/crates/matrix-sdk/src/encryption/backups/mod.rs index 6881b5cc847..4272eac1237 100644 --- a/crates/matrix-sdk/src/encryption/backups/mod.rs +++ b/crates/matrix-sdk/src/encryption/backups/mod.rs @@ -423,8 +423,12 @@ impl Backups { } /// Set the state of the backup. - fn set_state(&self, state: BackupState) { - self.client.inner.e2ee.backup_state.global_state.set(state); + fn set_state(&self, new_state: BackupState) { + let old_state = self.client.inner.e2ee.backup_state.global_state.set(new_state); + + if old_state != new_state { + info!("Backup state changed from {old_state:?} to {new_state:?}"); + } } /// Set the backup state to the `Enabled` variant and insert the backup key @@ -860,6 +864,7 @@ impl Backups { /// Listen for `m.secret.send` to-device messages and check the secret inbox /// if we do receive one. + #[instrument(skip_all)] pub(crate) async fn secret_send_event_handler(_: ToDeviceSecretSendEvent, client: Client) { let olm_machine = client.olm_machine().await; diff --git a/crates/matrix-sdk/src/encryption/recovery/mod.rs b/crates/matrix-sdk/src/encryption/recovery/mod.rs index bea746f77d4..152f4badeb6 100644 --- a/crates/matrix-sdk/src/encryption/recovery/mod.rs +++ b/crates/matrix-sdk/src/encryption/recovery/mod.rs @@ -488,7 +488,11 @@ impl Recovery { async fn update_recovery_state(&self) -> Result<()> { let new_state = self.check_recovery_state().await?; - self.client.inner.e2ee.recovery_state.set(new_state); + let old_state = self.client.inner.e2ee.recovery_state.set(new_state); + + if new_state != old_state { + info!("Recovery state changed from {old_state:?} to {new_state:?}"); + } Ok(()) }