Open artechventure opened 6 years ago
this is very critical for my app, and our users:( I have no idea why and when this happens.
@hughrawlinson any help here plz? :(
@hughrawlinson Today, I figured out(not sure) that It was not a spotify account's problem. I tried another account on my device, but same issue happened. What I figured out was, this issue depends on device and Spotify app version installed on a device, rather than a account's problem. When I deleted Spotify on my iphone and installed again, the issue was solved completely!
+1. This started happening recently to me, too.
@hughrawlinson Any comments here? I think it is a critical issue for 3rd party apps. Reinstalling spotify app can be a solution, but I can't tell every users in my app to do it. I don't understand why you guys ignoring this issue.
In my prototype app, I have a similar issue. After receiving a success response of a next track request (/v1/me/player/next
), I make immediately a user's currently playing track request (/v1/me/player/currently-playing
). 90% of the time, the received track is wrong. It stays the previous track that was played. Here's a simple snippet that shows the idea :
const headers = {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
};
axios.post('https://api.spotify.com/v1/me/player/next', {}, { headers })
.then((response) => {
if (response.status === 204) {
axios.get('https://api.spotify.com/v1/me/player/currently-playing', { headers })
.then((playingTrackRes) => {
if (playingTrackRes.status === 200) {
// playingTrackRes.data returns an incorrect currently playing track
}
});
}
});
I noticed that putting a 1 second delay before requesting the currently playing track (/v1/me/player/currently-playing
) returns the correct currently playing track.
Hi @artechventure, sorry for the delay. Can you confirm what version of the Spotify App you were using, and on what platform?
@hughrawlinson Since it's been happening to me too, I'll also try to provide feedback...
I haven't noticed this happening on Android Spotify 8.4.52.812, but on Linux Spotify 1.0.79.223, it does happens.
Also, sometimes, I start playing songs on my Linux Spotify client and the /me/player/currently-playing
simply won't ever give me my currently playing track (204
response code) until I restart the client.
Edit: If this bug happens again (which is not that rare), I'll try asking some of my friends if my currently playing track correctly shows on their friend feed (so that we can differentiate if the bug is probably on the desktop client or within the Web API).
@hughrawlinson In my case, the Spotify player playing the track is the player of the Web Playback SDK, used in Chrome on Linux. The version of the Web Playback SDK was the version available via CDN on April 15.
@hughrawlinson I can consistently reproduce this as well on several clients (I implemented a device picker into my application to test):
The issue reproduces less often (~50% of the time) on the latest version of the Web Player for Chrome.
For now, I'm using @ydrolet's suggestion of adding a setTimeout
before making the call to /v1/me/player/currently-playing
, but it'd be great to get this fixed to avoid arbitrary delays in third party code.
Just to add my observation: I got the 204
status for me/player
, too. Then I fired up Spotify on my Mac (1.0.75.483.g7ff4a0dc), and instantly the API would return the correct response again.
I've been testing the API using the curl
command from the API documentation:
curl -X "GET" "https://api.spotify.com/v1/me/player" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer -------"
I'm seeing the same issue. Some observations:
me/player
endpoint would consistently return correct information for which track is playing. me/player/devices
showed his device as active.me/player
usually doesn't work until I go into Spotify settings and toggle the "share my activity on Spotify" box a few times. me/player/devices
showed her device as inactive.I signed into my other user's other account via my web browser and started playing a song remotely on her Linux PC. Suddenly, her computer appears as active in the devices
endpoint and everything works great. Let's see if it continues to work tomorrow!
Update! As expected, it broke again today after restarting the machine. The API was serving up stale data.
Interestingly enough, when I signed into the Web Player, it was showing the same stale data in the playback status. I suspect this isn't an issue with the API per se, but with Spotify Connect. Once again, initiating playback from the web player and then passing control to the Linux client made the API start working.
Update 2! Today the application started working randomly. After I did some research, I learnt that my user had opened up Spotify on her Android phone. The Linux client started showing that device under Spotify Connect, and upon playback of the next track, it started sending out information about what's playing.
After a while, Spotify on the Android device was killed and the Linux client stopped sending out information about which track was playing - so the API started serving up stale data. I signed into the account from my phone and the playback information shown there was stale, as well. As soon as the next track started playing, everything started syncing seamlessly.
So I'm pretty sure that the bug here is that some clients don't ever update their Spotify Connect status unless there's another device.
@GranPC would you know whether this user is running an outdated Spotify client on his computer? Or some unofficial client?
@michaelherger This problem also happens with me, and I'm using an updated version (1.0.92.390).
I'm using a re-packaged version of Spotify (since, for Linux-based distros, there's only an "official" .deb
package only), provided by negativo17 as a .rpm
package.
But, this problem also happens with other users that run Spotify on Windows, for example (updated versions too). So I doubt this bug happens because of outdated version or unofficial client usage.
Thanks @BloodShura. Good to know!
In my user's case they're using the official Spotify deb. Not sure what version, but I know the system is up to date so probably the latest one.
Possibly my final update. My user's computer died and they replaced it with a new Linux box, with a fresh Spotify install. The API seems to work flawlessly now - no need to login with another device to get it working. :woman_shrugging:
Issue found on 3/16 2018.
Endpoint(s):
Scope(s):
Steps to reproduce:
Expected behaviour:
The response contains accurate information about what is currently playing in the Spotify client.
Actual behaviour:
The response contains incorrect information. -> The respones is correct when just started streaming -> When I change song A to B, the response is still song A -> When I pause song A, the response is still song A with is_playing status true.( when paused, response should be none ), -> Is_playing value is often false when playing
=> It works again when log out, and log in again the spotify client, but often happens again