diff --git a/src-tauri/src/api/mod.rs b/src-tauri/src/api/mod.rs index fc96336..5ea20f7 100644 --- a/src-tauri/src/api/mod.rs +++ b/src-tauri/src/api/mod.rs @@ -22,8 +22,15 @@ pub struct MyceliumClient { impl MyceliumClient { pub fn new(base: impl Into) -> Self { + // Mycelium's HTTP server seems to drop idle keep-alive connections + // around the 10s mark; reusing a pooled stale connection surfaces + // as a generic "error sending request" once `start_daemon` + // returned. Open a fresh TCP connection per request — overhead is + // negligible on loopback and immune to server-side closes. let http = Client::builder() + .pool_max_idle_per_host(0) .timeout(Duration::from_secs(10)) + .connect_timeout(Duration::from_secs(3)) .build() .expect("reqwest client build"); Self {