Skip to content

SoTW: Save to Spotify #14

Description

@kellenGary

Summary

Fix the Song of the Week (SoTW) "Save to Spotify" functionality — playlist creation/updating fails because the OAuth scopes granted during user sign-up are insufficient.

Background

  • When a user tries to save a SoTW playlist to their Spotify account, the operation fails silently or errors out.
  • The root cause appears to be that the client scopes requested during Spotify OAuth sign-up do not include the permissions needed to create and modify playlists.
  • The Spotify Web API requires specific scopes (playlist-modify-public, playlist-modify-private) for playlist write operations.

Scope

Backend (C# API)

  • Review the Spotify OAuth configuration to identify which scopes are currently being requested.
  • Add the necessary playlist-write scopes (playlist-modify-public and/or playlist-modify-private) to the OAuth flow.
  • Verify the playlist creation and update endpoints handle errors gracefully and return meaningful messages.

Frontend (React Native)

  • Ensure the user is prompted to re-authorize if their existing token lacks the required scopes.
  • Display appropriate error/success feedback when saving a playlist.

Spotify API Reference


Definition of Done

  • Scopes updated: The OAuth flow requests playlist-modify-public and/or playlist-modify-private scopes.
  • Playlist creation works: A new user can successfully save a SoTW playlist to their Spotify account after signing up.
  • Playlist update works: An existing SoTW playlist can be updated with new tracks on subsequent weeks.
  • Re-auth handling: Existing users with old tokens are prompted to re-authorize to gain the new scopes.
  • Error handling: If playlist save fails, the user sees a clear error message (not a silent failure).
  • Success feedback: On successful save, the user sees confirmation that the playlist was created/updated.
  • Build passes: Both the C# API and the frontend compile without errors.
  • Manual verification: Tested end-to-end with a fresh Spotify account — sign up → generate SoTW → save to Spotify → verify playlist appears in Spotify.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions