Skip to content

fix(capture): explain macOS -3821 stops caused by low disk space - #1497

Open
EtienneLescot wants to merge 1 commit into
mainfrom
pilot/fix-1496
Open

EtienneLescot wants to merge 1 commit into
mainfrom
pilot/fix-1496

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Refs #1496

When macOS ends a take with SCStreamErrorDomain -3821 ("Stream was stopped by the system"), the warning used to quote the raw NSError. It now names the likely cause:

  • recordings volume under 15 GB free: "macOS stopped the recording because the disk is almost full (8.5 GB free). Free up space and record again. The part recorded until then was saved."
  • otherwise, or when free space can't be measured: "macOS stopped the recording. The part recorded until then was saved."

Free space comes from statfs on the recording's folder, no native change. Other interruptions keep their existing message. The pre-recording HUD warning and an automatic stream restart (points 2 and 3 of the issue) are left out on purpose: they are product calls.

Tests: npx vitest --run electron/recording (163 passed), both typechecks, npm run lint.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved warnings for recordings stopped by macOS when the destination drive is low on space. When less than 15 GB is available, the warning now reports the estimated free space and recommends freeing space.
    • When space is sufficient or cannot be measured, a general macOS-stopped warning is shown. Other interruption warnings continue to include their reason.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The macOS recording stop outcome now checks available disk space for ScreenCaptureKit error -3821. It reports a disk-space warning below 15,000,000,000 bytes and a general stop warning when space is sufficient or cannot be measured. Other interruption reasons remain in the warning.

Changes: macOS capture stop warnings

Layer / File(s) Summary
Disk-aware interruption warning
electron/recording/nativeMacCaptureStop.ts, electron/recording/nativeMacCaptureStop.test.ts
The stop outcome measures available space beside the output file. For error -3821, it reports available GB below the threshold and uses a general stop warning otherwise. Tests cover low, sufficient, and unavailable space.

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

Change: Bug fix

Possibly related issues

  • Issue 1496 reports recordings stopping with error -3821 when disk space is low. This PR changes the warning and reports available space; the requested pre-recording warning and recovery are outside its scope.

Possibly related PRs

Merge Risk: Minimal · up to 17a61

The warnings distinguish low disk space from other macOS stops while preserving the generic fallback when space cannot be measured. No concrete merge-blocking risk was established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly describes the low-disk warning for macOS -3821 stops.
Description check Passed The description covers the change, related issue, scope, and testing. Add the template headings and specify the change type, release impact, and desktop impact. Add screenshots or video if applicable.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f8c0c5a7-d906-40c0-ba75-a68838d8d5ad
Commits

Reviewing files that changed from the base of the PR and between bc8d0a0 and 17a61e5.

Files selected for processing: 2

  • electron/recording/nativeMacCaptureStop.test.ts
  • electron/recording/nativeMacCaptureStop.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

This branch has not been deployed

No deployments
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