Skip to content

Fix a crash showing search results with two copies of a song - #425

Merged
hatstand merged 1 commit into
masterfrom
claude/project-thread-rf7abf
Nov 27, 2026
Merged

hatstand merged 1 commit into
masterfrom
claude/project-thread-rf7abf

Conversation

@hatstand

Copy link
Copy Markdown
Contributor

Requested by John · project thread

Depends on no other pull request.

Fixes #390, which Play reopened with a report from 13.15 (version code 2151), after the Downloads tab fix in 13.11.

The search results list each song under a key of its section and what it's browsed by: source, album artist, album and title. Two songs with all of those the same, such as an MP3 and a FLAC of one song in the same album, or two tracks of an album with the same title, got the same key, and the LazyColumn threw IllegalArgumentException: Key ... was already used from LayoutNodeSubcompositionsState.subcompose, the top frame of Play's trace. This affects both Clementine's global search and the search of the library on the phone, which share the list.

Each result's key now also counts the results before it with the same selection, so keys stay the same as before for every result that isn't a copy.

Testing

SearchScreenTest.showsTwoCopiesOfTheSameSong searches a library with two copies of a song. On its own, before the fix, it fails in CI with the same exception as Play's reports (run):

java.lang.IllegalArgumentException: Key "(SONGS, [Library, Erik Satie, Pièces, Vexations])" was already used.

Play's traces don't name the key, so this is the likeliest cause from reading every keyed list in the app, not a certainty. The other lists' keys are unique by construction (database primary keys, groupBy or distinct results, or download ids).


Generated by Claude Code

@hatstand hatstand self-assigned this Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Store screenshots

From run 46030879576, against clementine-it. Left: the store listing of the latest release, v13.15, which shows the dark theme. Right: this pull request, dark and light.

Screen v13.15 This PR, dark This PR
1_player
2_library
2_library_album
3_playlist
4_search
5_connection
6_connect
10_internet –
11_internet_radio –
fold_half_open_player –
fold_inner_player –
fold_outer_player –
settings –

@hatstand
hatstand enabled auto-merge (rebase) November 27, 2026 16:04
The search results list each song under a key made of its section and
what it's browsed by: where it came from, album artist, album and title.
Two songs with all of those the same, such as an MP3 and a FLAC of one
song in the same album, or two tracks of an album with the same title,
then had the same key, and the list crashed with an
IllegalArgumentException (issue #390). Each result's key now also counts
the results before it with the same selection.

Release-note: Fixed a crash when search found two songs with the same title on the same album.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R2bAq86gzrpUJ68mxNbEGc
@hatstand
hatstand force-pushed the claude/project-thread-rf7abf branch from 55d46b3 to 08d4a2e Compare November 27, 2026 16:07
@hatstand
hatstand merged commit 4a0585c into master Nov 27, 2026
9 checks passed
@hatstand
hatstand deleted the claude/project-thread-rf7abf branch November 27, 2026 16:21
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.

Crash: IllegalArgumentException in InlineClassHelperKt.throwIllegalArgumentException

2 participants