Skip to content

Fix truncated results for chunked (partial) command responses#183

Open
OzGav wants to merge 1 commit into
mainfrom
claude/quirky-newton-SXzcT
Open

Fix truncated results for chunked (partial) command responses#183
OzGav wants to merge 1 commit into
mainfrom
claude/quirky-newton-SXzcT

Conversation

@OzGav

@OzGav OzGav commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Fixes music-assistant/support#4371

The server streams large API command results (such as playlist tracks for big playlists) as multiple SuccessResultMessages: every 500 items is sent with partial=True, followed by a final message with partial=False. The client ignored the partial flag and resolved the command on the first message, so callers only ever received the first 500 items.

Accumulate partial result chunks (keyed by message_id) in both the listening and non-listening code paths, and only return once the final (non-partial) message arrives.

Also fix get_playlist_tracks: it accepted a page argument that the server endpoint does not use (the server returns the whole listing in one call, streamed in chunks). Replace it with the force_refresh argument that the server actually supports.

Verified against the real client code with a server-accurate mock (501/1000/2347-track playlists all return in full; confirmed the pre-fix code truncated at 500).

The server streams large API command results (such as playlist tracks for
big playlists) as multiple SuccessResultMessages: every 500 items is sent
with partial=True, followed by a final message with partial=False. The
client ignored the `partial` flag and resolved the command on the first
message, so callers only ever received the first 500 items.

Accumulate partial result chunks (keyed by message_id) in both the
listening and non-listening code paths, and only return once the final
(non-partial) message arrives.

Also fix get_playlist_tracks: it accepted a `page` argument that the server
endpoint does not use (the server returns the whole listing in one call,
streamed in chunks). Replace it with the `force_refresh` argument that the
server actually supports.
@OzGav OzGav added the bug Something isn't working label Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to list all tracks in large (2K tracks) "universal playlist"

2 participants