Skip to content

fix: handle remixes/contest page shape in mobile play queue drawer#14270

Open
dylanjeffers wants to merge 1 commit intomainfrom
claude/youthful-gauss-838419
Open

fix: handle remixes/contest page shape in mobile play queue drawer#14270
dylanjeffers wants to merge 1 commit intomainfrom
claude/youthful-gauss-838419

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

Fixes a crash in the mobile play queue drawer when a contest track is the source of playback.

Root cause

QueueDrawer.useNextFromSourceMobile reads the source lineup from the tan-query cache and iterates each page with for (const item of page). This works for lineups whose page shape is Array<{id, type}> (feed, trending, profile, search, history, etc.), but the remixes/contest lineup — built by useRemixes / useRemixesLineup and used by ContestSubmissionsTab.tsx:174 — wraps its items in { count: number, tracks: Array<{id, type}> }. Iterating that object with for-of throws TypeError: page is not iterable, which crashes the drawer the moment the user opens it while a contest track is playing.

Fix

Unwrap page.tracks when 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

  • Mobile: play a track from the Contest screen Submissions tab, open the play queue drawer — drawer renders without crashing, "Up Next" populates with upcoming submission tracks not yet in the queue.
  • Mobile: regression — play from feed / trending / profile, open the queue drawer — "Up Next" still populates as before.

🤖 Generated with Claude Code

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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

⚠️ No Changeset found

Latest commit: 8f5db28

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant