[Mobile] Fix play queue crash on contest/remix pages by normalizing lineup shape#14271
Merged
dylanjeffers merged 1 commit intomainfrom May 7, 2026
Merged
[Mobile] Fix play queue crash on contest/remix pages by normalizing lineup shape#14271dylanjeffers merged 1 commit intomainfrom
dylanjeffers merged 1 commit intomainfrom
Conversation
The mobile play queue drawer (and web "Up Next") iterates the source
query's `data.pages` expecting each page to be a flat `LineupItem[]`.
`useRemixes` instead stored `{ count, tracks: LineupItem[] }` per page,
so once a contest/remix track started playing the drawer threw
`TypeError: page is not iterable`.
Rather than unwrap the odd shape inside the queue drawer (which would
have been a one-off workaround), conform `useRemixes` to the standard
lineup-page shape used everywhere else (`useProfileTracks`, etc.):
- `useRemixes` now returns `LineupData[]` per page — same as every
other lineup query.
- `useRemixesCount` is the new dedicated count-only query, keyed
separately from the lineup. The lineup queryFn primes the count
cache so consumers using both don't pay an extra round-trip.
- `useRemixesLineup` reads `count` via `useRemixesCount`.
- `useAllRemixContests` primes the new count key.
- All call sites that did `pages?.[0]?.count` now use `useRemixesCount`
(web ContestPage / RemixesPage / PickWinnersPage / ContestCard /
ArtistRemixContestEndedNotification, mobile ContestCard /
TrackRemixesScreen / ContestSubmissionsTab).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14271.audius.workers.dev Unique preview for this PR (deployed from this branch). |
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
TypeError: page is not iterable) whenever a contest or remix page was the playback source.useRemixesstored each tan-query page as{ count, tracks: LineupItem[] }, while every other lineup query (and the queue drawer / web 'Up Next' code that iteratesdata.pages) expects a flatLineupItem[]per page.Changes
useRemixesnow returns flatLineupData[]per page — matchinguseProfileTracksand friends.useRemixesCount(regular query, not infinite) carries the total count. The lineup queryFn primes the count cache so consumers reading both don't pay an extra round-trip.useRemixesLineupreadscountviauseRemixesCount;useAllRemixContestsprimes the new count key.pages?.[0]?.countconsumers touseRemixesCount:ContestPage,RemixesPage(desktop),PickWinnersPage,ContestCard,ArtistRemixContestEndedNotificationContestCard,TrackRemixesScreen,ContestSubmissionsTabContestPage.test.tsxmocks to match.Test plan
ContestCard(explore grid) and the submissions pill on the Contest page still show the correct totals (not zero, not "growing as you scroll").🤖 Generated with Claude Code