fix: handle remixes/contest page shape in mobile play queue drawer#14270
Open
dylanjeffers wants to merge 1 commit intomainfrom
Open
fix: handle remixes/contest page shape in mobile play queue drawer#14270dylanjeffers wants to merge 1 commit intomainfrom
dylanjeffers wants to merge 1 commit intomainfrom
Conversation
The "Up Next from source" section in QueueDrawer assumed every lineup
page was a `LineupItem[]`. The remixes/contest lineup uses
`{ count, tracks: LineupItem[] }` instead, so iterating with `for-of`
over the page object threw `TypeError: page is not iterable` and
crashed the drawer whenever a contest track was the source of
playback. Unwrap `page.tracks` when present.
Co-Authored-By: Claude Opus 4.7 (1M context) <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
Fixes a crash in the mobile play queue drawer when a contest track is the source of playback.
Root cause
QueueDrawer.useNextFromSourceMobilereads the source lineup from the tan-query cache and iterates each page withfor (const item of page). This works for lineups whose page shape isArray<{id, type}>(feed, trending, profile, search, history, etc.), but the remixes/contest lineup — built byuseRemixes/useRemixesLineupand used by ContestSubmissionsTab.tsx:174 — wraps its items in{ count: number, tracks: Array<{id, type}> }. Iterating that object withfor-ofthrowsTypeError: page is not iterable, which crashes the drawer the moment the user opens it while a contest track is playing.Fix
Unwrap
page.trackswhen the page is an object instead of an array, in QueueDrawer.tsx:251-256. All other lineup shapes continue to work unchanged.The same bug exists in the equivalent web hook (useNextFromSource.ts:40-50); leaving that for a separate fix since the report was mobile-only.
Test plan
🤖 Generated with Claude Code