Skip to content

Keep uploads alive on congested uplinks - #2702

Open
heidar-droid wants to merge 1 commit into
CapSoftware:mainfrom
heidar-droid:fix-upload-resilience
Open

heidar-droid wants to merge 1 commit into
CapSoftware:mainfrom
heidar-droid:fix-upload-resilience

Conversation

@heidar-droid

@heidar-droid heidar-droid commented Oct 18, 2026 •

Copy link
Copy Markdown

On a slow or bufferbloated uplink (a phone hotspot in our case), the upload itself fills the link and the connectivity probe's 5s HEAD to the web app times out. Uploads then pause as "network loss" and give up after 5 minutes. The cap stays in processing and the desktop app refuses new recordings while the upload is marked active. Logs show Network loss detected followed by Network recovery timeout exceeded (5 minutes), giving up, while the same HEAD answers in 0.2s once the upload stops.

Changes in upload.rs: probe timeout 5s to 20s, recovery window 5 to 30 minutes, max multipart chunk 15 MB to 5 MB so a part fits the 5-minute PUT timeout on slow links and a failed part is cheaper to resend.

RetriggerView in GreptileConfidence Score: 4/5

Fix the reduced maximum upload size before merging.

Findings

  1. P1 Large exports stop uploading ▶
Fix with agent prompt
### Issue 1
apps/desktop/src-tauri/src/upload.rs:139
Capping every part at 5 MiB lowers the largest S3 upload from about 146 GiB to 48.8 GiB. `from_pending_file_to_chunks` keeps increasing `part_number`, so larger files reach part 10,001 and S3 rejects the upload after thousands of parts have been sent. Paid users can reach this path through `upload_exported_video` without a size or duration cap.

Keep smaller parts for slow links, but increase their size when needed to stay within S3’s 10,000-part limit.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Gives uploads more time to survive slow or congested connections.

  • Desktop uploads use smaller parts and wait longer for slow connections.

Reviews (1) · Last reviewed commit: "fix(desktop): keep uploads alive on cong..." · Reviewed by Greptile

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 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 18, 2026 10:05pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 18, 2026 22:05 Inactive
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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Large exports stop uploading

Capping every part at 5 MiB lowers the largest S3 upload from about 146 GiB to 48.8 GiB. from_pending_file_to_chunks keeps increasing part_number, so larger files reach part 10,001 and S3 rejects the upload after thousands of parts have been sent. Paid users can reach this path through upload_exported_video without a size or duration cap.

Keep smaller parts for slow links, but increase their size when needed to stay within S3’s 10,000-part limit.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src-tauri/src/upload.rs
Line: 139

Comment:
**Large exports stop uploading**

Capping every part at 5 MiB lowers the largest S3 upload from about 146 GiB to 48.8 GiB. `from_pending_file_to_chunks` keeps increasing `part_number`, so larger files reach part 10,001 and S3 rejects the upload after thousands of parts have been sent. Paid users can reach this path through `upload_exported_video` without a size or duration cap.

Keep smaller parts for slow links, but increase their size when needed to stay within S3’s 10,000-part limit.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 2cce251a Deployed Oct 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant