You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing some weird behavior when I use your package to control one particular Spotify Connect device, specifically an instance of Home Assistant on a Raspberry Pi 4 (w/ HifiBerry DAC2 Pro attached) running the Spotify Connect addon
When I create a client using sp.WithRetry(true) and call a control method like client.Next() while connected to the Home Assistant device, the call never returns and nothing is getting logged, but the client is quite obviously sending the command to the device over and over again because I can hear the tracks skipping and the skipping stops as soon as I kill the process.
When I use the same client with sp.WithRetry(true) but connected to the desktop Spotify app or an Echo device. It works as expected and returns immediately.
When I use another client without sp.WithRetry(true) (option omitted completely) it has no problem controlling the Home Assistant device. It works as expected and returns immediately.
The WithRetry option is described as only retrying on rate limiting errors, but it appears to be doing more than that. Do you know why that might be? Is there any way to get a client to log more about why it's retrying? Thanks.
Update: I was able to drop some print statements into your spotify.go to make it print out status codes, and when I am connected to the desktop app or an echo device, the Spotify Web API returns an HTTP 204, but when connected to the Home Assistant device, the API returns an HTTP 202. When I look at your shouldRetry function, I can see that you are marking 202 as a status that should be retried. This doesn't really make sense to me given that HTTP status codes that begin with 2 indicate some variant of success, so I am not sure why you are marking it as needing to be retried. The Spotify documentation indicates that the request was successfully received but is not yet completed.
When I remove that check for http.StatusAccepted from your code, I am able to use a client with sp.WithRetry(true) while connected to the Home Assistant device.
funcshouldRetry(statusint) bool {
returnstatus==http.StatusTooManyRequests// return status == http.StatusAccepted || status == http.StatusTooManyRequests
}
The text was updated successfully, but these errors were encountered:
I am seeing some weird behavior when I use your package to control one particular Spotify Connect device, specifically an instance of Home Assistant on a Raspberry Pi 4 (w/ HifiBerry DAC2 Pro attached) running the Spotify Connect addon
When I create a client using
sp.WithRetry(true)
and call a control method likeclient.Next()
while connected to the Home Assistant device, the call never returns and nothing is getting logged, but the client is quite obviously sending the command to the device over and over again because I can hear the tracks skipping and the skipping stops as soon as I kill the process.When I use the same
client
withsp.WithRetry(true)
but connected to the desktop Spotify app or an Echo device. It works as expected and returns immediately.When I use another
client
withoutsp.WithRetry(true)
(option omitted completely) it has no problem controlling the Home Assistant device. It works as expected and returns immediately.The
WithRetry
option is described as only retrying on rate limiting errors, but it appears to be doing more than that. Do you know why that might be? Is there any way to get aclient
to log more about why it's retrying? Thanks.Here's the sample code I was using to test this.
Update: I was able to drop some print statements into your spotify.go to make it print out status codes, and when I am connected to the desktop app or an echo device, the Spotify Web API returns an HTTP 204, but when connected to the Home Assistant device, the API returns an HTTP 202. When I look at your
shouldRetry
function, I can see that you are marking 202 as a status that should be retried. This doesn't really make sense to me given that HTTP status codes that begin with 2 indicate some variant of success, so I am not sure why you are marking it as needing to be retried. The Spotify documentation indicates that the request was successfully received but is not yet completed.When I remove that check for
http.StatusAccepted
from your code, I am able to use aclient
withsp.WithRetry(true)
while connected to the Home Assistant device.The text was updated successfully, but these errors were encountered: