Repository navigation
feat(genre-tree)!: drop TrackListProvider list polling, add updateTrack - #429
Merged
Merged
Conversation
TrackListProvider kept an unfiltered page-1 library list query active once any tracklist existed, refetched on every curation invalidation and window focus. On grow that ran a COUNT(*) over the whole song table and timed out with 503s. BREAKING CHANGE: TrackListProvider no longer accepts listEndpoint/listQueryKey. Call useTrackList().updateTrack(track) from a track mutation's onSuccess instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mutation-refresh # Conflicts: # CHANGELOG.md
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
Once anything had been played,
TrackListProviderkept auseListTracksquery running:GET library/songs/?page=1&pageSize=50, with no filter. It used the result to swap in "fresh" copies of tracks that were in the playing list. Every grow curation mutation invalidated that query (referenceSongsroot), and so did window refocus. On grow prod, each refetch ran aCOUNT(*)over about 32Mgrow_songrows, hit the 30s statement timeout, and returned a 503. That is what showed up while browsing Motown.The approach was also wrong on its own terms: page 1 of a global list almost never contains the tracks of a genre or artist list. Freshness now comes from the mutation that changed the track.
Changes
TrackListProviderdrops thelistEndpoint/listQueryKeyprops, the internal list query and thecurrentTrackListmerge.useTrackList().updateTrack(track)replaces the track with the same uuid on every loaded page, and in the selected track. When no track matches, it does nothing and returns the same list object.useListTracksis still exported, because hear's uploaded-library page uses it directly.api/libraryheader comment and the CHANGELOG are updated, including a migration note.Test plan
updateTracktests: it replaces a track on a later page and the selected track; it is a no-op (same object) for an unknown uuid; it is a no-op when there is no list.pnpm lint && pnpm build && pnpm test: 552 app-kit tests and 393 app-kit-ui tests pass.library/songs/?page=1&pageSize=50request.🤖 Generated with Claude Code