From 39d1ed9bc60296355e8cb7cf5e1a2ca5794775e6 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 3 Jul 2025 15:32:25 +0200 Subject: [PATCH] chore: exclude the room id / event id from the data to be sent to sentry These are not included in Element's main privacy policy, and may constitute PII (because the homeserver may include the name of some user). We keep the information as separate log lines, so that rageshakes/manual reports still include those. --- crates/matrix-sdk-sqlite/src/state_store.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/matrix-sdk-sqlite/src/state_store.rs b/crates/matrix-sdk-sqlite/src/state_store.rs index 306d7d673..90fc2c5bc 100644 --- a/crates/matrix-sdk-sqlite/src/state_store.rs +++ b/crates/matrix-sdk-sqlite/src/state_store.rs @@ -395,13 +395,6 @@ impl SqliteStateStore { serde_path_to_error::deserialize(json_deserializer).map_err(|err| { let raw_json: Option> = serde_json::from_slice(&decoded).ok(); - let (room_id, event_id) = if let Some(raw) = raw_json { - let room_id = raw.get_field::("room_id").ok().flatten(); - let event_id = raw.get_field::("event_id").ok().flatten(); - (room_id, event_id) - } else { - (None, None) - }; let target_type = std::any::type_name::(); let serde_path = err.path().to_string(); @@ -409,11 +402,18 @@ impl SqliteStateStore { error!( sentry = true, %err, - maybe_room_id = ?room_id, - maybe_event_id = ?event_id, "Failed to deserialize {target_type} in the state state: {serde_path}", ); + if let Some(raw) = raw_json { + if let Some(room_id) = raw.get_field::("room_id").ok().flatten() { + warn!("Found a room id in the source data to deserialize: {room_id}"); + } + if let Some(event_id) = raw.get_field::("event_id").ok().flatten() { + warn!("Found an event id in the source data to deserialize: {event_id}"); + } + } + err.into_inner().into() }) }