Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(upload): log missing segments and emit upload complete on signal failure

Richie McIlroy5ed3468b893c
diff --git a/apps/desktop/src-tauri/src/upload.rs b/apps/desktop/src-tauri/src/upload.rs
index 6a09c8142..eaf30f877 100644
--- a/apps/desktop/src-tauri/src/upload.rs
+++ b/apps/desktop/src-tauri/src/upload.rs
@@ -1135,6 +1135,22 @@ impl SegmentUploader {
}
}
+ {
+ let s = state.lock().unwrap_or_else(|e| e.into_inner());
+ if !s.failed_segments.is_empty() {
+ let missing: Vec<_> = s
+ .failed_segments
+ .iter()
+ .map(|f| f.subpath.as_str())
+ .collect();
+ error!(
+ count = s.failed_segments.len(),
+ segments = ?missing,
+ "Completing upload with missing segments - video may have gaps"
+ );
+ }
+ }
+
let final_manifest = state
.lock()
.unwrap_or_else(|e| e.into_inner())
@@ -1173,6 +1189,8 @@ impl SegmentUploader {
meta.save_for_project().ok();
}
+ emit_upload_complete(&app, &video_id);
+
return Err(format!(
"Failed to signal recording complete for {video_id} after 3 attempts"
)