mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-25 23:45:52 +03:00
[GH-ISSUE #503] Spotify API seemingly had a breaking change a few days ago #165
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#165
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ppege on GitHub (Nov 30, 2024).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/503
Describe the bug
A clear and concise description of what the bug is.
Several of Spotify's API endpoints are now returning errors to the requests
rspotifyis issuing it. For example:This seems to be happening after this new update that just came out for Spotify's web API. More context in this issue.
To Reproduce
Steps to reproduce the behavior:
For me, this error appears when I await the
AuthCodeSpotifyclient'scurrent_user_playlistsmethod.Expected behavior
Usually this method would simply get the playlists of the authenticated user. Auth does seem to work currently though.
Log/Output data
If applicable, add log data or output data to help explain your problem.
Additional context
Add any other context about the problem here.
@buzzneon commented on GitHub (Dec 1, 2024):
I'm seeing this too - specifically a result of calling
current_user_playlists_manual, the API is return null entries in the array:(Note, I truncated the output - omitting the valid playlists). It appears that the null playlists are the ones which Spotify generated for me, specifically the "Your top songs 2023". A "simple" fix for this would be to have
current_user_playlistsandcurrent_user_playlists_manualreturnPage<Option<SimplifiedPlaylist>>, though that's a breaking change which isn't terribly appealing. Maybe have those function internally filter out the null entries? I like this from the perspective of a user of this library; however there will be a performance hit (which doesn't bother me, but I can't speak for everyone!).@buzzneon commented on GitHub (Dec 1, 2024):
I mocked something up, which I have working locally, in
rspotify-modal/src/page.rsyou can define a way to build aPageof firm values from a Page of optional ones. This will consume the page of optional values, and move allSome<T>items from one page to the other (no copying or cloning). I tried to make a PR, but I don't think I have access.I wrote a test for this too:
And I hooked it up to
current_user_playlists_manualinsrc/clients/oauth.rs:I imagine the same trait could be implemented for
CursorBasedPagetoo.I only tested this on
current_user_playlists_manualsince that was the only API call I am making which was failing, and I can confirm that it now works, without breaking compatibility.@ramsayleung commented on GitHub (Dec 2, 2024):
Thanks for your report:
Do you have any clue why would the Spotify generate fnull playlists for your "Your top songs 2023", how does it looks like in your player?
@CameronSilverTXI commented on GitHub (Dec 2, 2024):
In the Spotify app, the playlists appear without issues .. I assume returning
nullhere is part of Spotify's supposed "security improvements" behind the API changes.@dzubybb commented on GitHub (Dec 21, 2024):
Is it possible that those "security improvements" are the reason that i'm getting null in context from current_playback, even when other device is playing some playlist ?
@ramsayleung commented on GitHub (Jul 8, 2025):
This problem should be fixed by this PR https://github.com/ramsayleung/rspotify/pull/526, v0.15.0 is out, which should address this issue.