From 39f641d4679f99d46d223aa95ee90964b2cb7f70 Mon Sep 17 00:00:00 2001 From: CodeGhost21 <164498022+CodeGhost21@users.noreply.github.com> Date: Wed, 13 May 2026 23:31:06 +0530 Subject: [PATCH] fix(team): preserve anyhow cause chain in backend RPC error envelopes (OPENHUMAN-TAURI-AD) (#1647) --- src/openhuman/team/ops.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/openhuman/team/ops.rs b/src/openhuman/team/ops.rs index 1e4756dd9..9f830e9cd 100644 --- a/src/openhuman/team/ops.rs +++ b/src/openhuman/team/ops.rs @@ -63,11 +63,22 @@ async fn get_authed_value( ) -> Result { let token = require_token(config)?; let api_url = effective_api_url(&config.api_url); - let client = BackendOAuthClient::new(&api_url).map_err(|e| e.to_string())?; + let client = BackendOAuthClient::new(&api_url).map_err(|e| format!("{e:#}"))?; + // `{e:#}` renders the full anyhow chain. `authed_json` wraps the + // underlying reqwest error with `.context(format!("backend request {} {}", …))` + // (`api/rest.rs::authed_json`), so plain `e.to_string()` only emits + // the outer "backend request GET /teams" label and drops the cause + // (connect timeout, DNS failure, TLS handshake, non-2xx status, …) + // before the JSON-RPC layer reports it to Sentry. OPENHUMAN-TAURI-AD + // is the canonical instance: 2 events on `0.53.35` from a Russia + // user, all with the truncated label and elapsed_ms=49 — far too + // short for a real timeout, so the underlying cause is the only + // signal worth surfacing. Same failure mode the `report_error` + // doc-string in `core/observability.rs` calls out (TAURI-B2). client .authed_json(&token, method, path, body) .await - .map_err(|e| e.to_string()) + .map_err(|e| format!("{e:#}")) } pub async fn get_usage(config: &Config) -> Result, String> {