Skip to content

fix(rendering): open recordings with an unreadable mic track - #2075

Merged
richiemcilroy merged 6 commits into
mainfrom
fix/unreadable-mic-track-open
Aug 4, 2026
Merged

fix(rendering): open recordings with an unreadable mic track#2075
richiemcilroy merged 6 commits into
mainfrom
fix/unreadable-mic-track-open

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

Investigating #2069 (claimed 0-byte audio-input.ogg files in studio mode) showed the reported mechanism cannot occur, but it surfaced a real robustness gap: the editor refused to open an entire recording when the mic track is unreadable, even though the display and camera tracks decode fine. The single-segment path even panicked.

Changes

  • crates/rendering/src/project_recordings.rs: an unreadable mic file now degrades to "no mic audio" with a warning instead of failing (or panicking on) the recording open. This mirrors the existing system-audio handling from fbc8755 and matches playback, which already degrades a broken mic track in loaded_track. Export is untouched and keeps failing loudly rather than silently dropping a track.
  • crates/enc-ffmpeg/src/mux/ogg.rs: regression tests pinning the OggFile/OpusEncoder path the issue claimed was broken: 5s of 96kHz mono input produces a playable file of the right duration, sub-frame input is flushed at finish rather than dropped, and a zero-frame track still writes container header pages instead of a 0-byte file.

Verification

  • cargo test -p cap-enc-ffmpeg: all 49 tests pass, including the 3 new ones.
  • cargo check -p cap-rendering -p cap-editor -p cap-export clean; clippy clean for the touched code.
  • End-to-end: cloned a real studio + camera bundle and truncated segment-0/audio-input.ogg to 0 bytes. Before this change the open fails with "segment 0 / mic / Failed to open audio: End of file"; after it, the recording opens and renders frame 0, with a warning logged.

Greptile Summary

The PR allows recordings with unreadable microphone tracks to open by treating those tracks as absent while retaining strict export behavior.

  • Adds Ogg/Opus regression coverage for sustained 96 kHz input, sub-frame flushing, and empty tracks.
  • Updates the mobile React Native patch version and synchronizes the pnpm lockfile.
  • Includes formatting-only changes to billing UI and payment-failure email copy.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/rendering/src/project_recordings.rs Gracefully degrades unreadable microphone metadata to no microphone track in single- and multi-segment recording-open paths.
crates/enc-ffmpeg/src/mux/ogg.rs Adds regression tests covering playable 96 kHz input, sub-frame encoder flushing, and nonempty zero-frame containers.
apps/mobile/package.json Updates React Native from 0.83.6 to 0.83.10.
pnpm-lock.yaml Synchronizes the dependency graph for the React Native patch update and related workspace resolutions.

Reviews (2): Last reviewed commit: "fix(mobile): bump react-native to expo-e..." | Re-trigger Greptile

…ty input

Regression tests for the studio mic path (OpusEncoder into OggFile):
5s of 96kHz mono input must land on disk with the right duration,
input shorter than one opus frame must be flushed at finish rather
than dropped, and a track that never received a frame must still
write container header pages instead of a 0-byte file.
An unreadable or empty mic file failed the entire recording open with
"segment N / mic / Failed to open audio" even when display and camera
decode fine, and the single-segment path panicked outright. Degrade the
mic to no-audio with a warning instead, matching the system-audio
handling from fbc8755 and playback's existing loaded_track behavior.
Export still validates audio strictly so a track is never silently
dropped from a deliverable.
@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​react-native@​0.83.107710099100100

View full report

@socket-security

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm react-native is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: apps/mobile/package.jsonnpm/react-native@0.83.10

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/react-native@0.83.10. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy merged commit f5f47c9 into main Aug 4, 2026
30 of 31 checks passed
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