Skip to content

fix: clearAll() leaks audio files (#101) - #107

Merged
karansinghgit merged 2 commits into
mainfrom
fix/clearall-audio-leak
Jul 10, 2026
Merged

fix: clearAll() leaks audio files (#101)#107
karansinghgit merged 2 commits into
mainfrom
fix/clearall-audio-leak

Conversation

@karansinghgit

Copy link
Copy Markdown
Owner

Fixes #101.

Problem

HistoryService.clearAll() removed transcript items but left their backing audio files on disk forever, so "Clear All" silently leaked storage:

func clearAll() {
    items.removeAll()
    saveHistory()
}

Fix

Delete each item's audio file before clearing, reusing the existing removeAudioFileIfNeeded(for:) — the same thing deleteItem does by default.

Deliberately not changed: stats

The issue also expected statsEntries to reset. I left stats intact on purpose: the Clear All confirmation dialog explicitly says "This removes your saved transcripts, but keeps your statistics history." Resetting stats would contradict that documented promise. If you'd actually prefer Clear All to wipe stats too, that's a product decision — say the word and I'll update both the method and the dialog copy in a follow-up.

Test plan

  • Record a few transcriptions (creates audio files) → Clear All → audio files are gone from Application Support; stats history remains.

…101)

HistoryService.clearAll() removed transcript items but left their audio files
on disk forever, so "Clear All" leaked storage. Delete each item's audio file
first, matching deleteItem's deleteAudioFile: true default.

Stats are intentionally left untouched — the Clear All dialog explicitly
promises "keeps your statistics history," so resetting statsEntries would
contradict documented behavior.

Fixes #101.
@karansinghgit
karansinghgit merged commit 0889d1e into main Jul 10, 2026
2 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.

bug: clearAll() leaks audio files and never resets stats

1 participant