From bfcf398664afcf2fea057117adc636b0f10aa8ce Mon Sep 17 00:00:00 2001 From: CodeGhost21 <164498022+CodeGhost21@users.noreply.github.com> Date: Wed, 13 May 2026 22:40:33 +0530 Subject: [PATCH] fix(whatsapp_data): preserve anyhow cause chain in RPC error envelopes (OPENHUMAN-TAURI-6B) (#1639) --- src/openhuman/whatsapp_data/rpc.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/openhuman/whatsapp_data/rpc.rs b/src/openhuman/whatsapp_data/rpc.rs index b6a2d18d5..dba7952de 100644 --- a/src/openhuman/whatsapp_data/rpc.rs +++ b/src/openhuman/whatsapp_data/rpc.rs @@ -40,8 +40,15 @@ pub async fn whatsapp_data_ingest(req: IngestRequest) -> Result")`, + // so plain Display ({e}) only emits the outer context and drops + // the underlying SQLite cause (database locked, schema mismatch, + // FK violation, …) before it reaches Sentry. See OPENHUMAN-TAURI-6B + // / TAURI-B2 for the canonical instance where this masked the + // real failure. + log::warn!("[whatsapp_data][rpc] ingest error: {e:#}"); + format!("[whatsapp_data] ingest failed: {e:#}") })?; log::debug!( "[whatsapp_data][rpc] ingest ok chats={} messages={} pruned={}", @@ -67,8 +74,8 @@ pub async fn whatsapp_data_list_chats( ); let store = require_store()?; let chats = ops::list_chats(&store, req).map_err(|e| { - log::warn!("[whatsapp_data][rpc] list_chats error: {e}"); - format!("[whatsapp_data] list_chats failed: {e}") + log::warn!("[whatsapp_data][rpc] list_chats error: {e:#}"); + format!("[whatsapp_data] list_chats failed: {e:#}") })?; log::debug!("[whatsapp_data][rpc] list_chats ok count={}", chats.len()); Ok(RpcOutcome::single_log( @@ -87,8 +94,8 @@ pub async fn whatsapp_data_list_messages( ); let store = require_store()?; let msgs = ops::list_messages(&store, req).map_err(|e| { - log::warn!("[whatsapp_data][rpc] list_messages error: {e}"); - format!("[whatsapp_data] list_messages failed: {e}") + log::warn!("[whatsapp_data][rpc] list_messages error: {e:#}"); + format!("[whatsapp_data] list_messages failed: {e:#}") })?; log::debug!("[whatsapp_data][rpc] list_messages ok count={}", msgs.len()); Ok(RpcOutcome::single_log( @@ -108,8 +115,8 @@ pub async fn whatsapp_data_search_messages( ); let store = require_store()?; let results = ops::search_messages(&store, req).map_err(|e| { - log::warn!("[whatsapp_data][rpc] search_messages error: {e}"); - format!("[whatsapp_data] search_messages failed: {e}") + log::warn!("[whatsapp_data][rpc] search_messages error: {e:#}"); + format!("[whatsapp_data] search_messages failed: {e:#}") })?; log::debug!( "[whatsapp_data][rpc] search_messages ok count={}",