From 217d1174d0f5df66d3545714949f6d491873fbaa Mon Sep 17 00:00:00 2001 From: Paddy <89168564+patrickballard@users.noreply.github.com> Date: Sun, 25 Oct 2026 02:10:15 +0000 Subject: [PATCH] fix(recording): let the preparing preview accept segment start times ee6011964 started writing start-times.json beside every segment for crash recovery, but the preparing projection's inventory never accounted for it. Every Studio recording then failed the projection with "Unrepresented source files or respawn layouts require ordinary finalization", and the editor showed the preparing shell without its live preview. Account for the file per segment; a cleanly stopped segment's timing still comes from its metadata. --- .../src/recovery/preparing_projection.rs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/crates/recording/src/recovery/preparing_projection.rs b/crates/recording/src/recovery/preparing_projection.rs index 37ce3e5a119..70b05557191 100644 --- a/crates/recording/src/recovery/preparing_projection.rs +++ b/crates/recording/src/recovery/preparing_projection.rs @@ -11,7 +11,10 @@ use cap_project::{ StudioRecordingStatus, VideoMeta, }; -use super::{IncompleteRecording, RecoveryManager, is_apple_double, reject_recovery_link}; +use super::{ + IncompleteRecording, RecoveryManager, SEGMENT_START_TIMES_FILE, is_apple_double, + reject_recovery_link, +}; use crate::studio_recording::CleanStoppedStudioClaim; const MAX_JSON_BYTES: u64 = 8 * 1024 * 1024; @@ -229,6 +232,9 @@ pub(super) fn project( return Err("Stopped cursor sidecar does not match discovery".into()); } let keyboard_path = keyboard(&mut inventory, metadata, &segment_dir)?; + inventory + .files + .remove(&segment_dir.join(SEGMENT_START_TIMES_FILE)); if let Some(notch) = metadata.display_notch && (!notch.x.is_finite() || !notch.width.is_finite() || !notch.height.is_finite()) { @@ -1139,6 +1145,28 @@ mod tests { assert!(fixture.project().is_ok()); } + #[test] + fn preparing_projection_accepts_segment_start_times_but_not_other_extra_files() { + let fixture = Fixture::new(2); + let segments = fixture.directory.path().join("content/segments"); + for index in 0..2 { + std::fs::write( + segments + .join(format!("segment-{index}")) + .join(SEGMENT_START_TIMES_FILE), + br#"{"display":0.0}"#, + ) + .unwrap(); + } + assert!(fixture.project().is_ok()); + + std::fs::write(segments.join("segment-1/stray.json"), b"{}").unwrap(); + assert_eq!( + fixture.project().err().as_deref(), + Some("Unrepresented source files or respawn layouts require ordinary finalization") + ); + } + #[test] fn preparing_projection_compares_writer_float_representation_and_rejects_unknown_fields() { let fixture = Fixture::new(1);