BlueHuskyStudios / BlueHuskyStudios/DeadassSimpleMediaPlayer

`delete(playlistWithID:)` can leave memory and disk disagreeing — contradicting its own doc

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub
Automatically found bug good first issue
Dominant language
Swift
Stars
0
Forks
3
Avg merge
2d 22h
Merged PRs (30d)
9

Description

```swift
/// Removes a saved playlist — from memory and disk together, so the two never disagree
func delete(playlistWithID id: SavedPlaylist.ID) throws {
savedPlaylists.removeAll { id == $0.id } // memory: already gone
guard let playlistsStore else { return }
try playlistsStore.delete(documentNamed: id.uuidString) // disk: may throw
}
```

If the disk delete throws, the playlist is gone from memory but still on disk — and reappears on next launch. The call site in `LibraryView` catches and shows a toast saying "Playlist not deleted," while the row has already vanished from the list. Either delete from disk first, or restore the in-memory entry on failure.

Contributor guide

Open the contributing guide

Research direction

Start at delete(playlistWithID:) and inspect the LibraryView call site that catches the error and shows the toast. Verify the failure path keeps memory and disk consistent, while a successful deletion removes the playlist from both; confirm the visible row and next-launch state match the result.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
database, mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.