@@ -1249,12 +1249,6 @@ impl OlmMachine {
1249
1249
} )
1250
1250
}
1251
1251
1252
- #[ instrument(
1253
- skip_all,
1254
- // This function is only ever called by decrypt_room_event, so
1255
- // room_id, sender, algorithm and session_id are recorded already
1256
- fields( sender_key, event_type) ,
1257
- ) ]
1258
1252
async fn decrypt_megolm_events (
1259
1253
& self ,
1260
1254
room_id : & RoomId ,
@@ -1264,7 +1258,12 @@ impl OlmMachine {
1264
1258
if let Some ( session) =
1265
1259
self . store ( ) . get_inbound_group_session ( room_id, content. session_id ( ) ) . await ?
1266
1260
{
1267
- tracing:: Span :: current ( ) . record ( "sender_key" , session. sender_key ( ) . to_base64 ( ) ) ;
1261
+ // This function is only ever called by decrypt_room_event, so
1262
+ // room_id, sender, algorithm and session_id are recorded already
1263
+ //
1264
+ // While we already record the sender key in some cases from the event, the
1265
+ // sender key in the event is deprecated, so let's record it now.
1266
+ tracing:: Span :: current ( ) . record ( "sender_key" , debug ( session. sender_key ( ) ) ) ;
1268
1267
1269
1268
let result = session. decrypt ( event) . await ;
1270
1269
match result {
@@ -1317,7 +1316,7 @@ impl OlmMachine {
1317
1316
/// * `event` - The event that should be decrypted.
1318
1317
///
1319
1318
/// * `room_id` - The ID of the room where the event was sent to.
1320
- #[ instrument( skip_all, fields( ?room_id, event_id, sender, algorithm, session_id) ) ]
1319
+ #[ instrument( skip_all, fields( ?room_id, event_id, sender, algorithm, session_id, sender_key ) ) ]
1321
1320
pub async fn decrypt_room_event (
1322
1321
& self ,
1323
1322
event : & Raw < EncryptedEvent > ,
@@ -1331,7 +1330,10 @@ impl OlmMachine {
1331
1330
. record ( "algorithm" , debug ( event. content . algorithm ( ) ) ) ;
1332
1331
1333
1332
let content: SupportedEventEncryptionSchemes < ' _ > = match & event. content . scheme {
1334
- RoomEventEncryptionScheme :: MegolmV1AesSha2 ( c) => c. into ( ) ,
1333
+ RoomEventEncryptionScheme :: MegolmV1AesSha2 ( c) => {
1334
+ tracing:: Span :: current ( ) . record ( "sender_key" , debug ( c. sender_key ) ) ;
1335
+ c. into ( )
1336
+ }
1335
1337
#[ cfg( feature = "experimental-algorithms" ) ]
1336
1338
RoomEventEncryptionScheme :: MegolmV2AesSha2 ( c) => c. into ( ) ,
1337
1339
RoomEventEncryptionScheme :: Unknown ( _) => {
0 commit comments