From 2cce251a9678dd9de02d9a7c659d79413f6c6796 Mon Sep 17 00:00:00 2001 From: Vesper Date: Mon, 19 Oct 2026 00:02:30 +0200 Subject: [PATCH] fix(desktop): keep uploads alive on congested uplinks The connectivity probe gave cap.so 5s to answer a HEAD. While an upload saturates a slow or bufferbloated uplink (e.g. a phone hotspot), that request routinely takes longer, so uploads paused as 'network loss' and gave up after 5 minutes, leaving the cap stuck in processing and blocking new recordings. - probe timeout 5s -> 20s - network recovery window 5 min -> 30 min - max multipart chunk 15 MB -> 5 MB, so a single part fits the 5 min PUT timeout on slow links and a failed part costs less to resend Co-Authored-By: Claude Opus 5.5 --- apps/desktop/src-tauri/src/upload.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src-tauri/src/upload.rs b/apps/desktop/src-tauri/src/upload.rs index c7e1151e4de..bfb2aef1b91 100644 --- a/apps/desktop/src-tauri/src/upload.rs +++ b/apps/desktop/src-tauri/src/upload.rs @@ -136,8 +136,8 @@ pub struct UploadProgressEvent { } const MIN_CHUNK_SIZE: u64 = 5 * 1024 * 1024; -const MAX_CHUNK_SIZE: u64 = 15 * 1024 * 1024; -const NETWORK_RECOVERY_TIMEOUT: Duration = Duration::from_secs(5 * 60); +const MAX_CHUNK_SIZE: u64 = 5 * 1024 * 1024; +const NETWORK_RECOVERY_TIMEOUT: Duration = Duration::from_secs(30 * 60); const CONNECTIVITY_PROBE_INITIAL_DELAY: Duration = Duration::from_secs(2); const CONNECTIVITY_PROBE_MAX_DELAY: Duration = Duration::from_secs(30); @@ -2761,7 +2761,7 @@ async fn probe_connectivity(app: &AppHandle) -> bool { let url = app.make_app_url("/").await; app.state::() .head(&url) - .timeout(Duration::from_secs(5)) + .timeout(Duration::from_secs(20)) .send() .await .is_ok() @@ -2781,7 +2781,7 @@ async fn wait_for_network_recovery(app: &AppHandle, video_id: &str) -> bool { error!( video_id, elapsed_secs = start.elapsed().as_secs(), - "Network recovery timeout exceeded (5 minutes), giving up" + "Network recovery timeout exceeded (30 minutes), giving up" ); return false; }