feat(recording): recover crash-orphaned recordings into Recent recordings#24
Merged
Merged
Conversation
…ings Streaming-to-disk protects the bytes of an interrupted recording, but the take stayed invisible: the .session.json manifest is only written on stop, so a crashed recording never appears anywhere, and its WebM lacks the Duration header (patched only at finalize), breaking seeking. - list-recording-sessions adopts orphans: any recording-<id>.webm/.mp4 with no manifest and no active writer (stream registry, native capture targets, current session) gets a synthesized manifest with recovered: true; webcam sidecar attached when present on disk. - open-recording-session repairs the WebM Duration header once on first open, then drops the recovered flag so later opens skip the full-file read. Estimation parses the raw EBML tail (last Cluster Timecode + largest SimpleBlock offset) since the fix-webm-duration parser deliberately skips Cluster internals; handles unknown-size clusters from streamed MediaRecorder output. Unit-tested. - Recovered takes show an amber badge in Recent recordings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the crash-safety story. Streaming-to-disk (siddharthvaddem#616 upstream, siddharthvaddem#687 port) protects the bytes of an interrupted recording, but the take stayed invisible and broken:
.session.jsonmanifest is only written on stop — a crashed take never appears in Recent recordings;Infinity/N/A duration).Changes
list-recording-sessions: anyrecording-<id>.webm/.mp4without a manifest and without an active writer (stream registry, native capture target paths, current session) gets a synthesized manifest withrecovered: true; the webcam sidecar is attached when present. One-time — once the manifest exists it's a normal session.open-recording-session: on first open of a recovered take, the WebM Duration header is repaired on disk, then therecoveredflag is dropped so later opens skip the full-file read.electron/recording/recoverRecording.ts): raw EBML tail scan — last Cluster Timecode + largest SimpleBlock relative offset (≈ exact for MediaRecorder's 1 ms timescale). Hand-rolled because@fix-webm-duration/parserdeliberately skips Cluster internals. Handles unknown-size clusters from streamed output and falls back across false-positive ID matches. 4 unit tests.Native
.mp4orphans (mac/windows helper crashes) are adopted and listed too; their duration repair is N/A (not WebM) and playability depends on how the helper died — but at least the take is discoverable now.Verification
tsc 0 errors · biome clean · vitest 229/229 (4 new) · i18n-check 12 locales · vite build OK
🤖 Generated with Claude Code