Skip to content

fix(windows): retry locked MP4 finalization#130

Merged
TheOrcDev merged 1 commit into
TheOrcDev:mainfrom
petercr:fix/windows-mp4-finalization-lock-retry
Jul 14, 2026
Merged

fix(windows): retry locked MP4 finalization#130
TheOrcDev merged 1 commit into
TheOrcDev:mainfrom
petercr:fix/windows-mp4-finalization-lock-retry

Conversation

@petercr

@petercr petercr commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • retry transient Windows file-lock errors while syncing staged MP4 exports
  • keep MP4 as the preferred completed artifact instead of immediately falling back to MKV recovery
  • retain MKV fallback for non-transient export/finalization failures

Verification

  • cargo fmt --all
  • focused cargo test -p videorc-backend staged_mp4_sync_flushes_a_nonempty_file_and_rejects_an_empty_one was started but not completed in the local time window

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows recording publication reliability by retrying transient file-lock failures after recording ends.
    • Non-transient synchronization errors continue to fail immediately.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 355d92de-6f21-4fda-8b64-fcd0d097305f

📥 Commits

Reviewing files that changed from the base of the PR and between 44264f9 and f533677.

📒 Files selected for processing (1)
  • crates/videorc-backend/src/recording.rs

📝 Walkthrough

Walkthrough

MP4 staging synchronization now retries transient Windows file-lock failures using bounded exponential backoff. Non-transient errors and exhausted retries continue to fail immediately.

Changes

MP4 staging synchronization

Layer / File(s) Summary
Retry policy and lock detection
crates/videorc-backend/src/recording.rs
Adds retry count and backoff constants, plus Windows-specific detection of transient file-lock errors across the error chain.
Bounded synchronization retry loop
crates/videorc-backend/src/recording.rs
Replaces single-shot staging synchronization with a respawned retry loop that doubles backoff up to the configured maximum.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: theorcdev

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly captures the main change: Windows-specific retries for locked MP4 finalization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@TheOrcDev
TheOrcDev merged commit 96b35b6 into TheOrcDev:main Jul 14, 2026
3 of 5 checks passed
TheOrcDev added a commit that referenced this pull request Jul 14, 2026
Ships #131 (macOS camera/mic permission registration on first use — a
never-asked device now offers Enable + real TCC prompt instead of a
dead-end Settings link) and #130 (Windows: retry transient locked MP4
finalization, keep MP4 over MKV fallback).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants