mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-25 23:45:52 +03:00
[GH-ISSUE #452] json parse error when calling artist method #150
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#150
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 @aome510 on GitHub (Jan 6, 2024).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/452
Describe the bug
Client now returns
for every
artistrequest. The reason seems to be because Spotify changes the type offollowers.totaland other fields to float.To Reproduce
Steps to reproduce the behavior:
follower.totalis not an integer. Example result:followers.total,popularity@ramsayleung commented on GitHub (Jan 6, 2024):
It's weird that the total and popularity are marked as integer in their official document, but actually return float data.
I tried to reproduce this bug by following your instruction in the document console, but the response is different from yours.
followers.total,popularityare both integer rather than float.@maplefluff commented on GitHub (Jan 6, 2024):
im getting this same error too, think spotify may have changed something because this was all fine yesterday
response from curl:
@ramsayleung commented on GitHub (Jan 6, 2024):
Yes, I can reproduce your problem now, I've submitted a ticket to Spotify to ask for clarity: https://community.spotify.com/t5/Spotify-for-Developers/The-response-type-of-artist-endpoint-is-marked-as-Integer-in/m-p/5800044
@gansheer commented on GitHub (Jan 6, 2024):
Hi @ramsayleung, just so you know there is an error in the issue link
https://github.com/ramsayleung/rspotify/issues/452m(trailing m) in your Spotify ticket.@ramsayleung commented on GitHub (Jan 6, 2024):
Thanks for your heads-up, I've revised the link to the correct one. But it's odd that a developer replied in the ticket saying what he got with
curlwas integer data instead of float data.Unfortunately, this ticket is marked as spam...
I've submitted an abuse report.
@PMARZV commented on GitHub (Jan 6, 2024):
Hey here! Developing an app for android and i have the same problem with the GETARTISTS endpoint
@aome510 commented on GitHub (Jan 20, 2024):
I don't think Spotify will give their response anytime soon. I wonder if we have any plans to mitigate this issue @ramsayleung ?
@ramsayleung commented on GitHub (Jan 23, 2024):
One of the workarounds comes to my mind is converting the Integer type to float type to bypass the issue. But in my perspective, I don't think it's a great idea because
I personally prefer to keep escalating and making "noise" to the Spotify developers, the louder noise we could make, the higher probability the Spotify team could be aware of this problem and fix it.
@ramsayleung commented on GitHub (Jan 23, 2024):
I've sent a message to escalate this issue to the Spotify team via this link: https://support.spotify.com/ca-en/contact-spotify-support/, here is the response from their associate:
@aome510 commented on GitHub (Jan 23, 2024):
Great! Thank you @ramsayleung
@grantshandy commented on GitHub (Jan 29, 2024):
This issue is also holding up the development of a project of mine. If it isn't fixed soon by the spotify developers would rspotify support deserializing all
u32fields with a customDeserializera la#[serde(deserialize_with = "as_u32")]?as_u32would automatically convert float fields into int ones and keep the same default behavior as before. It's pretty hacky, but it would fix the issue for now/if it arises again (im feeling pretty pessimistic lol). It'd be a less permissive version ofserde-this-or-that'sas_u64.This solution wouldn't introduce breaking changes in the API as @ramsayleung pointed out, and the fix would continue to work if spotify does get around to fixing the issue. Plus, it would only have the overhead of converting any given
f64to au32. If there's any interest in this sort of fix, let me know and I can open up a PR pretty quick.@maplefluff commented on GitHub (Jan 29, 2024):
One thing you could do as a temporary workaround is this
@ramsayleung commented on GitHub (Jan 30, 2024):
But this temporary workaround only for the you, the sole developer who decides to engage this approach.
I would try to implement the
as_u32approach without imposing breaking change as a short term solution, as we actually don't know when will Spotify fix this issue.@grantshandy commented on GitHub (Jan 30, 2024):
Should I contribute the fix? I can do it in the next two days unless you'd like to implement it yourself.
@ramsayleung commented on GitHub (Jan 30, 2024):
I could provide the code snippet for your reference, feel free to contribute and issue a PR :)
@m-torhan commented on GitHub (Feb 1, 2024):
As I didn't see any PR related to this I let myself to implement it https://github.com/ramsayleung/rspotify/pull/457.
I tested it with https://github.com/aome510/spotify-player and it worked well.
@aome510 commented on GitHub (Feb 3, 2024):
Look like a workaround patch landed to
master. @ramsayleung do you have any plans to release a new version?@ramsayleung commented on GitHub (Feb 9, 2024):
I am on vacation right now, I will release a new version when I am back :)
On Sun, Feb 4, 2024 at 1:34 AM Thang Pham @.***> wrote:
@aome510 commented on GitHub (Mar 2, 2024):
I'm now getting the same error but with
get-several-tracksAPI call. To reproduce, runObserve that many fields expecting integer return float. The response that I got
Not sure if the above issue is only reproducible on my end because the same request on https://developer.spotify.com/documentation/web-api/reference/get-several-tracks still returns the correct type.
Found this issue when trying to investigate https://github.com/aome510/spotify-player/issues/383
@ramsayleung commented on GitHub (Mar 2, 2024):
I have to say, it's "scope creep" of Spotify's bug, other developers have reported the same observation in other endpoints, it becomes less possible to be patched and bypassed individually by the community-driven library, this problem has to be fixed by the Spotify itself.
@aome510 commented on GitHub (Mar 2, 2024):
Yeah, I agree. At the same time, it's kinda frustrating to see that Spotify doesn't seem to take any actions.
@ramsayleung commented on GitHub (Mar 3, 2024):
The new version of RSpotify would like to pend for a while for the response from Spotify, since it's meanless to release a new version while Spotify keeps breaking their endpoints, the community is unable to catch up to release new patch.
@ed9w2in6 commented on GitHub (Mar 7, 2024):
@aome510 @ramsayleung
Seems to be fixed ^_^
As expected this is caused by some library that they are using.
I am using
spotify_playertoday and found that at the theartistendpoint works now.@ramsayleung commented on GitHub (Mar 8, 2024):
Closing since this issue has been resolved by Spotify.