skuethe / MMM-Spotify

Spotify display and controller for MagicMirror
MIT License
66 stars 17 forks source link

Added handling for HTTP 429 to many requests error #173

Closed a-waider closed 2 years ago

a-waider commented 3 years ago

In addition to #172.

Would love to get some feedback on this.

skuethe commented 3 years ago

Thank you for the PR. I will need to fine some time to have a look at it in detail

WhiteSockedDancer commented 2 years ago

I've got the same problem after building my config and reloading the page alot.. now this is looping in console:

[16.11.2021 01:54.14.403] [ERROR] [SPOTIFY - JAYKAY] Response error text: Too Many Requests, [16.11.2021 01:54.14.408] [ERROR] [SPOTIFY - JAYKAY] Response error text: Too Many Requests, [16.11.2021 01:54.14.407] [ERROR] [SPOTIFY - JAYKAY] Response error code: 429, [16.11.2021 01:54.14.406] [ERROR] [SPOTIFY - JAYKAY] Invalid response, [16.11.2021 01:54.14.405] [ERROR] [SPOTIFY - JAYKAY] Failed to request API: /v1/me/player, [16.11.2021 01:54.14.402] [ERROR] [SPOTIFY - JAYKAY] Response error code: 429, [16.11.2021 01:54.14.401] [ERROR] [SPOTIFY - JAYKAY] Invalid response, [16.11.2021 01:54.14.103] [ERROR] [SPOTIFY - JAYKAY] Response error text: Too Many Requests, [16.11.2021 01:54.14.400] [ERROR] [SPOTIFY - JAYKAY] Failed to request API: /v1/me/player, [16.11.2021 01:54.14.103] [ERROR] [SPOTIFY - JAYKAY] Response error code: 429, [16.11.2021 01:54.14.102] [ERROR] [SPOTIFY - JAYKAY] Invalid response

skuethe commented 2 years ago

Sorry, I was rather busy. I will try to set some focus on this PR. Thanks for letting me now.

a-waider commented 2 years ago

@skuethe I just removed the redundant logging you mentioned. Anything else, that you're unhappy in this PR?

@WhiteSockedDancer As long as here is little movement you can use my fork of this repo. For me it works like a charm. But be aware that this repo will be deleted as soon as this bug is fixed in the master branch of this original repo.

skuethe commented 2 years ago

I did some adjustments to have a more generalized error and retry handling. @a-waider can you please verify if this still works for you? Thanks

a-waider commented 2 years ago

So, I did some testing. The PR works as intended. It strictly waits until the retry-timer elapsed.

Just to complete this error handling I added a hint to the restrictions list in the README.md.

From my point of view this PR is ready to be merged.