Skip to content

fix(recording): abort prune on unreadable project#561

Merged
meiiie merged 1 commit into
mainfrom
fix/prune-unreadable-project-fail-closed
May 22, 2026
Merged

fix(recording): abort prune on unreadable project#561
meiiie merged 1 commit into
mainfrom
fix/prune-unreadable-project-fail-closed

Conversation

@meiiie
Copy link
Copy Markdown
Collaborator

@meiiie meiiie commented May 22, 2026

Summary

  • Abort auto-recording prune when a saved project cannot be read or parsed.
  • Preserve the existing warning, but make the prune path fail closed instead of skipping the unreadable project.

Type of Change

  • Bug Fix
  • Refactor
  • Documentation
  • Test

Related Issue(s)

Why

This is a small #504 extraction. If a saved project is unreadable, pruning cannot safely know which recording paths are still protected by that project. Failing closed avoids deleting recordings that may still be referenced.

This PR intentionally does not include the broader #504 native route, CUDA compositor, binary manifest, or dev launcher changes.

Verification

  • npm test -- electron/ipc/recording/prune.test.ts
  • npx tsc --noEmit
  • npx biome check --formatter-enabled=false electron/ipc/recording/prune.ts electron/ipc/recording/prune.test.ts
  • git diff --check

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

📝 Walkthrough

Walkthrough

Error handling in loadSavedProjectMediaPaths changes from best-effort skipping of unreadable projects to a fail-fast approach that logs an abort warning and rethrows the error, converting pruning from graceful degradation to hard failure on metadata read/parse errors.

Changes

Pruning error handling

Layer / File(s) Summary
Error handling for unreadable saved projects
electron/ipc/recording/prune.ts
When a saved project file cannot be read or parsed, loadSavedProjectMediaPaths now logs an "[prune] Aborting…" warning with the project path and error, then rethrows the exception instead of logging a skip message and continuing.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • webadderallorg/Recordly#282: Updates pruning behavior in the same file to fail closed when saved project JSON or media paths cannot be read, avoiding orphaned recording pruning.

Suggested labels

Checked

Poem

🐰 A gentle skip became a shout,
When files won't read, we bail out—
No silent passing, now we warn,
The prune stops short when trust is torn.
Fail-fast and clear, let errors show!

🚥 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
Title check ✅ Passed The title clearly and concisely describes the main change: aborting the prune operation when a project file is unreadable, which is the primary behavioral modification in this PR.
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.
Description check ✅ Passed The PR description includes all major required sections: summary, type of change, related issue, motivation (Why), and verification steps.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/prune-unreadable-project-fail-closed

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 and usage tips.

@meiiie meiiie merged commit 7353ba9 into main May 22, 2026
4 checks passed
@meiiie meiiie deleted the fix/prune-unreadable-project-fail-closed branch May 22, 2026 13:10
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.

1 participant