Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 errors when attempting any action with the API #164

Open
banool opened this issue May 17, 2022 · 2 comments
Open

502 errors when attempting any action with the API #164

banool opened this issue May 17, 2022 · 2 comments
Labels
bug Something isn't working web Specific for web

Comments

@banool
Copy link
Collaborator

banool commented May 17, 2022

Is this a how to question?
No

Is this a native Spotify SDK issue?
No

Have you searched for existing issues?
Yes

Are you using a Free or Premium Spotify account?
Premium

Are you aware of the limitations of Free Spotify accounts?
Yes

Expected behavior
I can call the functions under SpotifySDK which are supported according to the README and they work.

Describe the bug
First, actual repro steps. The code in question is all here. You can go there and run flutter run -d chrome --release, log in, then hit "tune in". If you actually try these repro steps, I imagine I'll need to add your email to the set of authorized users for the app from the Spotify dashboard.

So, the problem I'm seeing is this. You can see here the code I use to login to Spotify. This works. After this however, any attempt to use the spotify SDK fails. For example, trying to queue up a track here. Instead, I get this error.

I've tried many things, such as:

  • Don't get an access token first, just connect.
  • Try different scopes.
  • Don't set a player name.
  • Await longer to get the player state (which also fails).
  • Try a bunch of other actions first, such as playing a track.

Strangely, the connection still seems to be somewhat alive, because from the desktop / web Spotify app I can see the player and play to it and it'll come from that web page.

I should say that everything works fine for iOS and Android.

Any help with this would be much appreciated, I'm pretty much out of ideas. Thanks a lot!

Steps to Reproduce
See above.

Screenshots
N/A

spotify_sdk Flutter package version
2.3.0

Target Platform, Version & Device

  • OS & Version: Web
  • Browser & Version: Chrome 101.0.4951.64
  • Device: M1 Mac 2022

Development OS

  • OS: MacOS

Additional context
N/A

@banool banool added the bug Something isn't working label May 17, 2022
@banool
Copy link
Collaborator Author

banool commented May 18, 2022

I looked at the example code and couldn't figure out what I'm doing differently also.

@banool
Copy link
Collaborator Author

banool commented May 25, 2022

Okay seems like the issues where these:

  • With the web API it works best to play a song first prior to queuing anything.
  • We don't want to always target a particular player, that causes the 502s.

For the latter, I've got some changes in https://github.com/banool/spotify_sdk/. I can make PRs out of these if folks think they're reasonable, but now I'll be using my own branch.

@fotiDim fotiDim added the web Specific for web label Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working web Specific for web
Projects
None yet
Development

No branches or pull requests

2 participants