lofi icon indicating copy to clipboard operation
lofi copied to clipboard

Constantly loses connection

Open ScottBeeson opened this issue 4 years ago • 10 comments

I discovered lofi a couple months ago and was SUPER excited. It's awesome! However, it would constantly lose connection to spotify. Basically every song. So I forgot about it. I reinstalled today hoping it was fixed, but it's not. What can I do? Is there a log I can provide? Is this a known issue?

ScottBeeson avatar Mar 05 '21 17:03 ScottBeeson

I was going to raise this but I see it's an existing issue. I have the same problem.

jraward avatar Aug 19 '21 12:08 jraward

This is probably a Spotify API polling issue not related to Lofi. If you open the debug panel (in the settings), you should see a bunch of 429 errors in there. The next release will provide a small tooltip when that happens.

Can you confirm it's a 429 error?

stamoun avatar Sep 13 '21 12:09 stamoun

@dvx We may want to check if we can move Lofi into Spotify's Extended Quota Mode. I think this could prevent all of these.

stamoun avatar Sep 13 '21 12:09 stamoun

Hi Nicholas, I’ll check for you tomorrow.

On Mon, 13 Sep 2021 at 13:24, Nicolas St-Amour @.***> wrote:

This is probably a Spotify API polling issue not related to Lofi. If you open the debug panel (in the settings), you should see a bunch of 429 errors in there. The next release will provide a small tooltip when that happens.

Can you confirm it's a 429 error?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dvx/lofi/issues/107#issuecomment-918139402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3ROFMV4GCSNIZR4Y2CTB3UBXURTANCNFSM4YVTCPBA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

jraward avatar Sep 13 '21 18:09 jraward

Could the polling be reduced a bit? Would that affect the behavior of the app too much?

joanbarros avatar Dec 28 '21 18:12 joanbarros

Having a slower polling rate would make the app appear unresponsive. Currently the Spotify API is polled every second for the track info (song, artist, track progress, etc.) and every 5 seconds to determine whether or not a track is liked.

We could raise the track info polling to 2 seconds, app responsiveness would take a hit, but the 429 issues would probably go away.

This could be a hidden setting in the config where it defaults to 1sec but could be changed easily (not via the UI).

stamoun avatar Dec 28 '21 19:12 stamoun

But now it reaches the limit and then it's unresponsive for +10s. So, maybe spreading it out a bit would make it seem more responsive.

I find myself repeatedly waiting for the warning sign to go out before I can click the like button because It won't work. If you don't notice that, you feel that the app is unresponsive for large amounts of time.

joanbarros avatar Dec 28 '21 19:12 joanbarros

The delay is exponential actually, you get throttled for 1 secs, then 2, then 4, then 10, etc. up to 50ish seconds iirc. This delay is 100% controlled by their backend.

The only way to prevent it is to lengthen the delays between polling, sadly.

Adding a configurable polling rate is easy.

stamoun avatar Dec 28 '21 19:12 stamoun

I think we should implement not a delay, but a call rate which the app should maintain. If we get a 249 then the rate is increased slightly. This should, in theory, sync the request rate with the APIs rate limit.

I can try to put together some improvements for us to test and see if it's a better experience.

joanbarros avatar Jan 03 '22 20:01 joanbarros

This is probably a Spotify API polling issue not related to Lofi. If you open the debug panel (in the settings), you should see a bunch of 429 errors in there. The next release will provide a small tooltip when that happens.

Can you confirm it's a 429 error?

Wanted to jump in with my experience - I am getting throttled almost constantly and have confirmed that the page has 429s in the debug panel. Therefore, I'd love to see either an option in the settings for the user to control the poll rate, or for us to explore the comment from @stamoun:

@dvx We may want to check if we can move Lofi into Spotify's Extended Quota Mode. I think this could prevent all of these.

This looks like a great option - could get the best of both worlds (responsive and no API throttling constantly).

Nickthegoatboy avatar Jan 07 '22 20:01 Nickthegoatboy