Skip to content

Commit e432960

Browse files
authored
feat: Better logging for failing securejoin messages (#7593)
This will make bugs like #7478 easier to debug (even though we may be able to fix #7478 without waiting for more logs)
1 parent 58cd133 commit e432960

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/receive_imf.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,12 +677,22 @@ pub(crate) async fn receive_imf_inner(
677677
let res = if mime_parser.incoming {
678678
handle_securejoin_handshake(context, &mut mime_parser, from_id)
679679
.await
680-
.context("error in Secure-Join message handling")?
680+
.with_context(|| {
681+
format!(
682+
"Error in Secure-Join '{}' message handling",
683+
mime_parser.get_header(HeaderDef::SecureJoin).unwrap_or("")
684+
)
685+
})?
681686
} else if let Some(to_id) = to_ids.first().copied().flatten() {
682687
// handshake may mark contacts as verified and must be processed before chats are created
683688
observe_securejoin_on_other_device(context, &mime_parser, to_id)
684689
.await
685-
.context("error in Secure-Join watching")?
690+
.with_context(|| {
691+
format!(
692+
"Error in Secure-Join '{}' watching",
693+
mime_parser.get_header(HeaderDef::SecureJoin).unwrap_or("")
694+
)
695+
})?
686696
} else {
687697
securejoin::HandshakeMessage::Propagate
688698
};

0 commit comments

Comments
 (0)