Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/desktop/src-tauri/src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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.

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);

Expand Down Expand Up @@ -2761,7 +2761,7 @@ async fn probe_connectivity(app: &AppHandle) -> bool {
let url = app.make_app_url("/").await;
app.state::<HttpClient>()
.head(&url)
.timeout(Duration::from_secs(5))
.timeout(Duration::from_secs(20))
.send()
.await
.is_ok()
Expand All @@ -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;
}
Expand Down