fix: cleanup temporary audio files after transcription to prevent storage buildup#27
fix: cleanup temporary audio files after transcription to prevent storage buildup#27dhruvi-16-me wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
|
Please resolve the merge conflicts before review. Your PR will only be reviewed by a maintainer after all conflicts have been resolved. 📺 Watch this video to understand why conflicts occur and how to resolve them: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe transcription workflow now captures the recording path into a local variable and adds a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Important Merge conflicts detected (Beta)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
LGTM! resolve the merge conflixts |
|
@SharkyBytes Will fix this PR today. Last night left it in between. |
Closes #19
📝 Description
This PR addresses the issue of temporary audio files not being deleted after transcription. Currently, each consultation recording is stored in the temporary directory but never cleaned up, leading to potential storage accumulation over time.
The solution ensures that recorded audio files are deleted after every transcription attempt, regardless of whether the process succeeds, fails, or exits early. This is achieved using a
try/finallypattern to guarantee cleanup across all execution paths.Additionally, the implementation safely handles file deletion to avoid impacting the user experience.
🔧 Changes Made
Updated
_transcribeAudio()inlib/main.dartto:_recordingPathin a local variable to prevent race conditionstry/finallyblock to ensure cleanupAdded
_deleteRecordingFile(String path)helper method:Ensured
_recordingPathis cleared after cleanup (when applicable)Covered all execution paths:
📷 Screenshots or Visual Changes (if applicable)
No visual changes. This PR focuses on internal resource cleanup and performance improvement.
🤝 Collaboration
Collaborated with:
N/A✅ Checklist
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.
Summary by CodeRabbit