[GH-ISSUE #680] [Issue]: Game Mode Spotify playlist source broken end-to-end on Development Mode apps (post-2026-03 API migration) #321

Closed
opened 2026-10-20 17:27:37 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (May 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/680

Summary

After Spotify's 2026-03 Web API migration, the /playlists/{id}/tracks endpoint is no longer accessible to Spotify Developer apps in Development Mode (without Extended Quota Mode approval). This breaks Marinara's Game Mode "playlist" source completely: every playlist 403s during scene-music shortlist building, and even the dropdown that lists playlists for selection shows misleading "(0)" track counts for every entry because Spotify also strips the tracks.total field from /me/playlists items.

Expected behavior

For users on Development Mode apps:

  • Self-owned playlists should be selectable from the dropdown and feed scene music normally.
  • The dropdown should show real track counts so users can pick a usable source.
  • Followed/editorial playlists (which Spotify always 403s for Dev Mode apps) should be clearly labeled as unavailable rather than silently failing.

Actual behavior

  1. Server-side playlist content fetch: packages/server/src/services/spotify/game-spotify-music.service.ts → fetchSpotifyTrackIndex calls GET /playlists/{id}/tracks. Spotify returns 403 Forbidden for every playlist, including ones owned by the connected user. The error surfaces as: Spotify scene music failed. (or via #659's fix, Spotify track index failed (403): Forbidden).
  2. Dropdown listing: packages/server/src/routes/spotify-auth.routes.ts → /playlists reads playlist.tracks?.total from GET /me/playlists. Spotify omits the tracks field entirely from each item under Development Mode. Every playlist therefore renders as Playlist Name (0) in ChatSettingsDrawer and GameSetupWizard.

Steps to reproduce

  1. Create a Spotify Developer app on or after 2024-11-27 (or any app without Extended Quota Mode approval).
  2. Connect it to a Marinara DJ agent.
  3. Enable Game Mode Spotify music with source = playlist.
  4. Open the playlist dropdown — every entry shows (0).
  5. Pick any playlist (owned or followed) and trigger a scene. Generic Spotify failure surfaces.

Verified empirically against the Spotify Web API with a Dev Mode app:

Endpoint Status Notes
GET /me 200 Premium account, tokens healthy
GET /me/tracks (Liked Songs) 200 Works — not restricted
GET /me/playlists 200 Works, but each item is missing the tracks field entirely
GET /playlists/{id} 200 Works, but missing the tracks field
GET /playlists/{id}/tracks 403 Forbidden The deprecated endpoint Marinara currently uses
GET /playlists/{id}/items (owned by me) 200 The supported replacement endpoint works
GET /playlists/{id}/items (followed) 403 Spotify policy: Dev Mode apps can only read playlists owned by the connected user

Environment

  • Marinara Engine version: v1.5.9 (upstream e07aee6)
  • Install type: docker (EasyPanel)
  • OS + version: Linode VPS server / Windows 11 Chrome client
  • Browser or app shell: Chrome
  • Spotify account: Premium (PH region)

Logs, screenshots, or video

Direct Spotify Web API trace (token from the connected DJ agent):

PUT /v1/playlists/<owned-id>/tracks    -> 403 Forbidden  "Forbidden"
GET /v1/playlists/<owned-id>/items     -> 200 OK,  total=75, items[0].item.uri = "spotify:track:..."
GET /v1/me/playlists item.keys()       -> ["collaborative","description","external_urls","href","id","images","name","owner","primary_color","public","snapshot_id","items","type","uri"]   (no "tracks" field)

Note that /items puts the playable under item.item (because an item may be a track or an episode), not under item.track like the deprecated /tracks endpoint did — so any mapper migrating to /items must coalesce both shapes for /me/tracks compatibility.

Additional context

  • Spotify's Web API quota modes docs confirm that Development Mode apps "can only get full details of the items of a playlist owned by a Spotify user if you have a quota extension". Extended Quota Mode requires 250k+ MAUs, so personal/hobby/self-hosted Marinara deployments cannot apply.
  • The companion fix (#660) for playGameSpotifyTrack covering the "no active device" path is already merged. This issue is the remaining half of the same end-to-end break for users on Dev Mode apps.
  • A PR is open against this issue.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (May 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/680 ## Summary After Spotify's 2026-03 Web API migration, the `/playlists/{id}/tracks` endpoint is no longer accessible to Spotify Developer apps in Development Mode (without Extended Quota Mode approval). This breaks Marinara's Game Mode "playlist" source completely: every playlist 403s during scene-music shortlist building, and even the dropdown that lists playlists for selection shows misleading "(0)" track counts for every entry because Spotify also strips the `tracks.total` field from `/me/playlists` items. ## Expected behavior For users on Development Mode apps: - Self-owned playlists should be selectable from the dropdown and feed scene music normally. - The dropdown should show real track counts so users can pick a usable source. - Followed/editorial playlists (which Spotify always 403s for Dev Mode apps) should be clearly labeled as unavailable rather than silently failing. ## Actual behavior 1. **Server-side playlist content fetch**: `packages/server/src/services/spotify/game-spotify-music.service.ts` → `fetchSpotifyTrackIndex` calls `GET /playlists/{id}/tracks`. Spotify returns **403 Forbidden** for every playlist, including ones owned by the connected user. The error surfaces as: `Spotify scene music failed.` (or via #659's fix, `Spotify track index failed (403): Forbidden`). 2. **Dropdown listing**: `packages/server/src/routes/spotify-auth.routes.ts` → `/playlists` reads `playlist.tracks?.total` from `GET /me/playlists`. Spotify omits the `tracks` field entirely from each item under Development Mode. Every playlist therefore renders as `Playlist Name (0)` in `ChatSettingsDrawer` and `GameSetupWizard`. ## Steps to reproduce 1. Create a Spotify Developer app on or after 2024-11-27 (or any app without Extended Quota Mode approval). 2. Connect it to a Marinara DJ agent. 3. Enable Game Mode Spotify music with source = `playlist`. 4. Open the playlist dropdown — every entry shows `(0)`. 5. Pick any playlist (owned or followed) and trigger a scene. Generic Spotify failure surfaces. Verified empirically against the Spotify Web API with a Dev Mode app: | Endpoint | Status | Notes | |---|---|---| | `GET /me` | 200 | Premium account, tokens healthy | | `GET /me/tracks` (Liked Songs) | 200 | Works — not restricted | | `GET /me/playlists` | 200 | Works, but each item is missing the `tracks` field entirely | | `GET /playlists/{id}` | 200 | Works, but missing the `tracks` field | | `GET /playlists/{id}/tracks` | **403 Forbidden** | The deprecated endpoint Marinara currently uses | | `GET /playlists/{id}/items` (owned by me) | 200 | The supported replacement endpoint works | | `GET /playlists/{id}/items` (followed) | 403 | Spotify policy: Dev Mode apps can only read playlists owned by the connected user | ## Environment - Marinara Engine version: v1.5.9 (upstream `e07aee6`) - Install type: docker (EasyPanel) - OS + version: Linode VPS server / Windows 11 Chrome client - Browser or app shell: Chrome - Spotify account: Premium (PH region) ## Logs, screenshots, or video Direct Spotify Web API trace (token from the connected DJ agent): ``` PUT /v1/playlists/<owned-id>/tracks -> 403 Forbidden "Forbidden" GET /v1/playlists/<owned-id>/items -> 200 OK, total=75, items[0].item.uri = "spotify:track:..." GET /v1/me/playlists item.keys() -> ["collaborative","description","external_urls","href","id","images","name","owner","primary_color","public","snapshot_id","items","type","uri"] (no "tracks" field) ``` Note that `/items` puts the playable under `item.item` (because an item may be a track *or* an episode), not under `item.track` like the deprecated `/tracks` endpoint did — so any mapper migrating to `/items` must coalesce both shapes for `/me/tracks` compatibility. ## Additional context - Spotify's [Web API quota modes docs](https://developer.spotify.com/documentation/web-api/concepts/quota-modes) confirm that Development Mode apps "can only get full details of the items of a playlist owned by a Spotify user if you have a quota extension". Extended Quota Mode requires 250k+ MAUs, so personal/hobby/self-hosted Marinara deployments cannot apply. - The companion fix (#660) for `playGameSpotifyTrack` covering the "no active device" path is already merged. This issue is the remaining half of the same end-to-end break for users on Dev Mode apps. - A PR is open against this issue. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:27:37 +07:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#321
No description provided.