From c727948c3fd2e4ba7bfc21f50a9057ed3e91ec28 Mon Sep 17 00:00:00 2001 From: Jazz Turner-Baggs <473256+jazzz@users.noreply.github.com> Date: Sat, 13 Jun 2026 08:57:06 -0700 Subject: [PATCH] Instrument call paths --- core/conversations/Cargo.toml | 1 + core/conversations/src/conversation.rs | 2 +- core/conversations/src/core.rs | 2 ++ core/conversations/src/inbox_v2.rs | 3 +++ extensions/components/src/delivery/local_broadcaster.rs | 3 +++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/conversations/Cargo.toml b/core/conversations/Cargo.toml index 7e681ac..922551d 100644 --- a/core/conversations/Cargo.toml +++ b/core/conversations/Cargo.toml @@ -27,6 +27,7 @@ prost = "0.14.1" rand_core = { version = "0.6" } safer-ffi = "0.1.13" thiserror = "2.0.17" +tracing = "0.1.44" x25519-dalek = { version = "2.0.1", features = ["static_secrets", "reusable_secrets", "getrandom"] } [dev-dependencies] diff --git a/core/conversations/src/conversation.rs b/core/conversations/src/conversation.rs index ba148db..78573c2 100644 --- a/core/conversations/src/conversation.rs +++ b/core/conversations/src/conversation.rs @@ -34,7 +34,7 @@ pub(crate) trait Convo { } /// Group-only operations. -pub(crate) trait GroupConvo: Convo { +pub(crate) trait GroupConvo: Convo + std::fmt::Debug { fn add_member( &mut self, cx: &mut ServiceContext, diff --git a/core/conversations/src/core.rs b/core/conversations/src/core.rs index 64dfe62..274a0d4 100644 --- a/core/conversations/src/core.rs +++ b/core/conversations/src/core.rs @@ -15,6 +15,7 @@ use openmls::group::GroupId; use shared_traits::IdentIdRef; use std::collections::HashMap; use storage::{ChatStore, ConversationKind, ConversationStore}; +use tracing::{info, instrument}; pub use crate::conversation::ConversationId; pub use crate::inbox::Introduction; @@ -313,6 +314,7 @@ impl<'a, S: ExternalServices + 'static> Core { } // Decode bytes and send to protocol for processing. + #[instrument(name = "core.handle_frame", skip_all, fields(user_id = %self.services.mls_identity.display_name()))] pub fn handle_payload(&mut self, payload: &[u8]) -> Result { let env = EnvelopeV1::decode(payload)?; diff --git a/core/conversations/src/inbox_v2.rs b/core/conversations/src/inbox_v2.rs index 0dd813b..7d5259c 100644 --- a/core/conversations/src/inbox_v2.rs +++ b/core/conversations/src/inbox_v2.rs @@ -11,6 +11,8 @@ use openmls::prelude::*; use prost::{Message, Oneof}; use std::cell::RefCell; use storage::{ConversationKind, ConversationMeta, ConversationStore}; +use tracing::info; +use tracing::instrument; pub use identity::MlsIdentityProvider; pub(crate) use mls_provider::MlsEphemeralPqProvider; @@ -122,6 +124,7 @@ impl InboxV2 { conversation_id_for(&self.ident_id) } + #[instrument(name = "inboxV2.handle_frame", skip_all, fields(user_id = %service_ctx.mls_identity.display_name()))] pub fn handle_frame( &self, service_ctx: &mut ServiceContext, diff --git a/extensions/components/src/delivery/local_broadcaster.rs b/extensions/components/src/delivery/local_broadcaster.rs index 5889def..f47807c 100644 --- a/extensions/components/src/delivery/local_broadcaster.rs +++ b/extensions/components/src/delivery/local_broadcaster.rs @@ -6,6 +6,7 @@ use std::{ }; use libchat::{AddressedEnvelope, DeliveryService}; +use tracing::info; #[derive(Debug)] struct BroadcasterShared { @@ -107,6 +108,7 @@ impl DeliveryService for LocalBroadcaster { type Error = String; fn publish(&mut self, envelope: AddressedEnvelope) -> Result<(), Self::Error> { + info!(?envelope.delivery_address, len=envelope.data.len(), "DS:Publish"); self.outbound_msgs.push(Self::msg_id(&envelope)); self.shared.borrow_mut().messages.push_back(envelope); @@ -114,6 +116,7 @@ impl DeliveryService for LocalBroadcaster { } fn subscribe(&mut self, delivery_address: &str) -> Result<(), Self::Error> { + info!(delivery_address, "DS:Subscribe"); // Strict temporal ordering of subscriptions is not enforced. // Subscriptions are evaluated on polling, not when the message is published self.subscriptions.insert(delivery_address.to_string());