mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-05 06:28:20 -04:00
logging(crypto): Add more logs when identity or devices change
This commit is contained in:
@@ -31,7 +31,7 @@ use ruma::{
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
use tracing::{instrument, trace, warn};
|
||||
use tracing::{debug, instrument, trace, warn};
|
||||
use vodozemac::{olm::SessionConfig, Curve25519PublicKey, Ed25519PublicKey};
|
||||
|
||||
use super::{atomic_bool_deserializer, atomic_bool_serializer};
|
||||
@@ -869,6 +869,13 @@ impl DeviceData {
|
||||
device_keys.ed25519_key().map(Box::new),
|
||||
))
|
||||
} else if self.device_keys.as_ref() != device_keys {
|
||||
debug!(
|
||||
user_id = ?self.user_id(),
|
||||
device_id = ?self.device_id(),
|
||||
keys = ?self.keys(),
|
||||
"Updated a device",
|
||||
);
|
||||
|
||||
self.device_keys = device_keys.clone().into();
|
||||
|
||||
Ok(true)
|
||||
|
||||
@@ -687,7 +687,7 @@ impl IdentityManager {
|
||||
.await
|
||||
{
|
||||
Ok(IdentityUpdateResult::Updated(identity)) => {
|
||||
trace!(?identity, "Updated a user identity");
|
||||
debug!(?identity, "Updated a user identity");
|
||||
changes.changed.push(identity);
|
||||
}
|
||||
Ok(IdentityUpdateResult::Unchanged(identity)) => {
|
||||
|
||||
@@ -175,7 +175,9 @@ impl CryptoStoreWrapper {
|
||||
if let Some(own_identity_after) = maybe_own_identity.as_ref() {
|
||||
// Only do this if our identity is passing from not verified to verified,
|
||||
// the previously_verified can only change in that case.
|
||||
if !own_identity_was_verified_before_change && own_identity_after.is_verified() {
|
||||
let own_identity_is_verified = own_identity_after.is_verified();
|
||||
|
||||
if !own_identity_was_verified_before_change && own_identity_is_verified {
|
||||
debug!("Own identity is now verified, check all known identities for verification status changes");
|
||||
// We need to review all the other identities to see if they are verified now
|
||||
// and mark them as such
|
||||
@@ -183,6 +185,12 @@ impl CryptoStoreWrapper {
|
||||
own_identity_after,
|
||||
)
|
||||
.await?;
|
||||
} else if own_identity_was_verified_before_change != own_identity_is_verified {
|
||||
// Log that the verification state of the identity changed.
|
||||
debug!(
|
||||
own_identity_is_verified,
|
||||
"The verification state of our own identity has changed",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user