Skip to content

fix: allow .m4a local media so macOS mic sidecars play - #1026

Open
muhammad-a-dev wants to merge 1 commit into
webadderallorg:mainfrom
muhammad-a-dev:fix/allow-m4a-media-types
Open

muhammad-a-dev wants to merge 1 commit into
webadderallorg:mainfrom
muhammad-a-dev:fix/allow-m4a-media-types

Conversation

@muhammad-a-dev

@muhammad-a-dev muhammad-a-dev commented Sep 24, 2026 •

Copy link
Copy Markdown

Problem

On macOS, native capture keeps mic and system audio as .m4a sidecars (recording-*.mic.m4a, recording-*.system.m4a). Those files were rejected by MEDIA_CONTENT_TYPES / isSupportedLocalMediaPath(), so get-local-media-url blocked them and the editor/export stayed silent even though the audio existed on disk.

Reported in #1016 (follow-up to #912).

Fix

  • Add ".m4a": "audio/mp4" to electron/mediaTypes.ts (matches how the renderer already treats .m4a in localMediaSource.ts).
  • Add a focused unit test in electron/mediaTypes.test.ts.

Path allowlisting is unchanged: reads are still scoped by isAllowedLocalReadPath() / session directories.

Testing

  • Added unit coverage for .m4a support and unsupported extensions.
  • Full Electron record/playback on macOS not run from this environment; logic matches the root cause and expected MIME in the issue.

Fixes #1016

Summary by CodeRabbit

  • New Features
    • Added support for local .m4a audio recordings, including microphone and system-audio files. These recordings are now recognized as audio media.

macOS native capture writes mic/system audio as .m4a sidecars. Without
.m4a in MEDIA_CONTENT_TYPES, get-local-media-url blocks those paths and
the editor/export stay silent even though the files exist on disk.

Fixes webadderallorg#1016
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: webadderallorg/Recordly/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 01aee329-798a-4f10-b596-e5558749c2fa

📥 Commits

Reviewing files that changed from the base of the PR and between 1888428 and 4ebb4dd.

📒 Files selected for processing (2)
  • electron/mediaTypes.test.ts
  • electron/mediaTypes.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The media type map now recognizes .m4a files as audio/mp4. Tests cover macOS microphone and system-audio sidecar paths, plus unsupported .txt paths.

Changes

Local media type support

Layer / File(s) Summary
M4A media type support
electron/mediaTypes.ts, electron/mediaTypes.test.ts
The media type map associates .m4a with audio/mp4. Tests check that .mic.m4a and .system.m4a paths are supported and that .txt paths are unsupported.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 4ebb4

The change enables local M4A sidecars while retaining the separate path checks. No material merge-blocking risk is indicated by the supplied context.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: allowing local .m4a media so macOS microphone sidecars can play.
Description check ✅ Passed The description explains the problem, fix, motivation, related issue, testing, and the limitation that full macOS playback testing was not run. It omits several template headings and the checklist, bu…
Linked Issues check ✅ Passed The pull request meets the coding requirements in issue #1016. electron/mediaTypes.ts maps .m4a to audio/mp4, which allows the macOS .mic.m4a and .system.m4a sidecars. `electron/mediaTypes.t…
Out of Scope Changes check ✅ Passed The changes stay within issue #1016. They contain only the required media-type allowlist entry and focused automated tests for .m4a support and unsupported extensions. No unrelated product behavior …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

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.

[Bug]: macOS mic sidecar (.m4a) is blocked by the media allowlist, so #912 still reproduces

1 participant