feat(tts): finish audio export with atomic temp-file pipeline - #18
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbb52ad99a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| dir=str(target.parent), | ||
| ) | ||
| os.close(fd) | ||
| _safe_unlink(temp_path) |
There was a problem hiding this comment.
Do not release the reserved ffmpeg temp name
When the user exports into a shared directory such as /tmp, this mkstemp result is immediately unlinked before ffmpeg is started, so the reserved pathname becomes available for another local process to recreate (for example via an inotify race and symlink) before ffmpeg opens it. That defeats the safety of the temp-file pipeline and can make ffmpeg write to an unintended file; keep the mkstemp path in place and let the existing -y overwrite/truncate that private temp file instead.
Useful? React with 👍 / 👎.
Summary
This finishes the audio export flow in the TTS window.
Included in this PR:
ffmpegwrites to a temp file in the target directory firstos.replace(...)on successful exportVerification
73 passed281 passedgit diff --check: ok./run.shok, OGG/MP3 perfile/ffprobegeprüftReview status
Codex read-only review could not be completed due to a usage-limit blocker, so an independent Codex second opinion is still outstanding.
Rollback