feat(genre-tree)!: load reference tree in one request, return arrays - #187
Merged
Merged
Conversation
useListFullGenrePlaylists now hits genre-playlists/tree/ for the reference scope and resolves to CriteriaPlaylistSimple[] for both scopes. BREAKING CHANGE: useListFullGenrePlaylists data is an array, not a paginated envelope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
The genre tree took about 13 s to load. The reference tree (about 1,712 genre playlists) was fetched as about 18 pages of 100 rows, which queued behind grow-api's 2 sync workers; the fan-out has also OOM-killed the proxy before. grow-api v11.1.0 now serves the whole reference tree, cached and ETag'd, at
GET /v1/genre-playlists/tree/?treeName=canonical. With this change app-kit loads the reference tree in one request.Changes
genrePlaylistEndpoints.reference.tree()→genre-playlists/tree/.useListFullGenrePlaylists:referencemakes a single fetch with{ treeName: "canonical" }and parses it withz.array(CriteriaPlaylistSimpleSchema).me(hear-api has no tree endpoint) still usesfetchAllPages, withFULL_LIST_CONCURRENCY = 4.fetchAllPagesnow returns the merged rows rather than a fake one-page envelope.CriteriaPlaylistSimple[]instead of{ results, … }.GenreTreeViewno longer needs its.results/as CriteriaPlaylistSimple[]casts.totalPages: 0and null pages.GenreTreeViewmocks now return arrays.### Breakingand### Changedentries under[Unreleased]. This goes out as a major release (9.0.0).Consumer follow-up
grow-the-music-tree-frontendGenreTreePage.tsxreadsgenrePlaylists?.results. When it bumps to 9.0.0 it must switch togenrePlaylists ?? []. hear-frontend doesn't read the hook's data, so it isn't affected.Test plan
pnpm lint && pnpm build && pnpm testpass locally, including the coverage thresholds.GET /v1/genre-playlists/tree/?treeName=canonicalreturns 200, and its array items matchCriteriaPlaylistSimpleSchema.🤖 Generated with Claude Code