fix(recording): make video validation non-blocking and use single timestamp

- finalizeStoredVideo now catches validateRecordedVideo errors instead of
  propagating them, so the editor opens even if ffmpeg validation fails
  (restores v1.1.3/v1.1.5 resilient behavior)
- Use a single Date.now() call for all native capture filenames on macOS
  to prevent timestamp drift between video/audio files
This commit is contained in:
webadderall
2026-03-30 13:32:16 +11:00
parent 3b755f85ab
commit ee29ca0947
+13 -7
View File
@@ -2605,7 +2605,12 @@ function snapshotCursorTelemetryForPersistence() {
}
async function finalizeStoredVideo(videoPath: string) {
const validation = await validateRecordedVideo(videoPath)
let validation: { fileSizeBytes: number; durationSeconds: number | null } | null = null
try {
validation = await validateRecordedVideo(videoPath)
} catch (error) {
console.warn('Video validation failed (proceeding anyway):', error)
}
snapshotCursorTelemetryForPersistence()
currentVideoPath = videoPath
@@ -2632,16 +2637,16 @@ async function finalizeStoredVideo(videoPath: string) {
supported: lastNativeCaptureDiagnostics.supported,
helperExists: lastNativeCaptureDiagnostics.helperExists,
processOutput: lastNativeCaptureDiagnostics.processOutput,
fileSizeBytes: validation.fileSizeBytes,
fileSizeBytes: validation?.fileSizeBytes ?? null,
})
}
return {
success: true,
path: videoPath,
message: validation.durationSeconds !== null
message: validation?.durationSeconds !== null && validation !== null
? `Video stored successfully (${validation.fileSizeBytes} bytes, ${validation.durationSeconds.toFixed(2)}s)`
: `Video stored successfully (${validation.fileSizeBytes} bytes)`
: `Video stored successfully`
}
}
@@ -3374,14 +3379,15 @@ body{background:transparent;overflow:hidden;width:100vw;height:100vh}
}
const helperPath = await ensureNativeCaptureHelperBinary()
const outputPath = path.join(recordingsDir, `recording-${Date.now()}.mp4`)
const timestamp = Date.now()
const outputPath = path.join(recordingsDir, `recording-${timestamp}.mp4`)
const capturesSystemAudio = Boolean(options?.capturesSystemAudio)
const capturesMicrophone = Boolean(options?.capturesMicrophone)
const systemAudioOutputPath = capturesSystemAudio
? path.join(recordingsDir, `recording-${Date.now()}.system.m4a`)
? path.join(recordingsDir, `recording-${timestamp}.system.m4a`)
: null
const microphoneOutputPath = capturesMicrophone
? path.join(recordingsDir, `recording-${Date.now()}.mic.m4a`)
? path.join(recordingsDir, `recording-${timestamp}.mic.m4a`)
: null
const config: Record<string, unknown> = {
fps: 60,