spotify-web-helper icon indicating copy to clipboard operation
spotify-web-helper copied to clipboard

Excessive `No user is logged in` spam when Spotify is closed

Open roncli opened this issue 7 years ago • 2 comments

The listen() function calls itself, and then calls this.compareStatus(). This works fine while Spotify is open, but when it's closed it suddenly spams the No user is logged in message, far exceeding the rate at which listen()` was originally being called.

There are a number of possible ways to resolve this.

I am doing it in my server app by not calling listen() until after this.compareStatus() returns successfully, and if it doesn't return successfully, I create a new Spotify web helper object on my next ping from my client. This would require returning the error to the user, and having them deal with it, which in my app I'm okay with.

Other options... If this is being caused by a number of different threads, listen() could be set to be invoked only once until it completely resolves. You could also introduce a short delay between listen() calls within the function itself.

roncli avatar May 15 '17 14:05 roncli

Made a PR #25, if you are happy, then I merge it!

JonnyBurger avatar Jun 01 '17 14:06 JonnyBurger

I believe this issue is solved with #39 which will emit a single error and stop emitting errors until Spotify is running normally again. I'll leave this issue open until it is merged.

itotallyrock avatar Jun 17 '18 18:06 itotallyrock