Repository navigation
fix(SafHelper): delete orphaned empty file when FD open fails after creation - #116
Closed
joselofarias-byte wants to merge 1 commit into
Closed
joselofarias-byte wants to merge 1 commit into
joselofarias-byte wants to merge 1 commit into
Conversation
…reation createAudioFile() created the SAF document via createFile() but returned null without cleanup if the subsequent openFileDescriptor() call failed (e.g. a transient SAF/DocumentsProvider glitch). The empty document was never tracked by AudioRecordingEngine (currentRecordingUri is only set after a successful SafResult), so it silently accumulated in the user's recordings folder on every occurrence. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8GvrjdRj8AM6ag4rsGsbH
Owner
|
Hi, do you have any error/logs that prove this is an issue? I don't remember ever hitting this during my tests, when it failed it did not make a file since it failed. I am asking because I cannot check the claude session to see more. Also, please edit the commit so it is authored by @joselofarias-byte and has Assisted-by: Claude Sonnet 5 in its message as per CONTRIBUTING.md. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main(fast-forward, no unique prior commits) after full inspection of the recording/call-detection/permission pipeline.SafHelper.createAudioFile(): ifContentResolver.openFileDescriptor()fails after the SAF document was already created viaDocumentFile.createFile(), the code returnednullwithout deleting the just-created document, leaving an orphaned, empty, untracked file behind in the user's chosen recordings folder on every such failure. The fix deletes the orphanedDocumentFilebefore returningnull.Testing
SKIP_SIGNING=true ./gradlew assembleDebug --stacktrace --no-daemon— BUILD SUCCESSFUL.openFileDescriptorfailure path (would require forcing a transient SAF/DocumentsProvider error), and a general end-to-end recording session sanity check.🤖 Generated with Claude Code
https://claude.ai/code/session_01G8GvrjdRj8AM6ag4rsGsbH