Closed pvrs12 closed 3 years ago
the only thing I can think to fix it would be adding a callbacks.updatePlayer.splice(i, 1);
to the catch block of the try/catch in the forEach
https://github.com/pvrs12/Anesidora/blob/a24ce8ccdcc8e212057dd8d6832445f9d979528e/common/js/background.js#L155
https://github.com/pvrs12/Anesidora/blob/a24ce8ccdcc8e212057dd8d6832445f9d979528e/common/js/background.js#L195
https://github.com/pvrs12/Anesidora/blob/a24ce8ccdcc8e212057dd8d6832445f9d979528e/common/js/background.js#L209
->
callbacks.updatePlayer.forEach((e, i) => {
try {
e();
} catch(b) {
callbacks.updatePlayer.splice(i, 1);
}
});
@hucario it seems likely that the changes tosetCallbacks
is the issue here.
What's the reasoning behind making these lists and adding to them each time the popup is rendered vs the single instance of the callback?
Edit: also, what's the difference with splice
ing the list and just keeping it as a single value?
@hucario it seems likely that the changes to
setCallbacks
is the issue here.What's the reasoning behind making these lists and adding to them each time the popup is rendered vs the single instance of the callback?
Often I keep a tab open with the player in it:
With the old system, when I opened the popup (often by accident trying to get to a different extension's popup) it would replace the callbacks, thus making the open tab out of date
also, what's the difference with
splice
ing the list and just keeping it as a single value?
splicing the list gets rid of functions that error- which are the functions of popups that were closed:
doing it like that keeps it as an array, which makes it possible to have multiple tabs / versions open without any of them going out of date, while keeping it as a single value keeps it as a single player
sure, it's an edge use case, but I didn't see any issues in implementing it
if it is causing the leak (which is possible, although unlikely as you would have to open/close the popup around ~1000 times by my estimate in order for it to cause a problem) and the fix doesn't do anything (which is unlikely if it was causing the leak) then sure, reimplement the single single value
but I like having my tab open
It doesn't hang as far as I can tell? Or at least, it doesn't freeze.
What happens is the player will show it stopped at the end of the last song it played. Then upon trying to play, skip to the next song, load another station, etc. the app just doesn't do anything. It will go to the "Play or resume last station" screen, but other than that nothing will play music again. The buttons all still highlight on mouseover, and I can go to the stations menu as well as whatever the lefthand menu is, in both old and new forms, but it won't start playing any music unless I restart the browser.
What happens is the player will show it stopped at the end of the last song it played. Then upon trying to play, skip to the next song, load another station, etc. the app just doesn't do anything. It will go to the "Play or resume last station" screen, but other than that nothing will play music again. The buttons all still highlight on mouseover, and I can go to the stations menu as well as whatever the lefthand menu is, in both old and new forms, but it won't start playing any music unless I restart the browser.
I suspect that the auth tokens may be expiring. I don't remember offhand when that's refreshed
That sounds like the login token expired.
Ah, now I think of it it's probably the anti-loop pattern I put in. (This was while requests were still synchronous and would hang the main thread, so I just made it so it would retry once.) Here's what's happening (I think):
dontRetryPartnerLogin === false
)dontRetryPartnerLogin === false
, so tries again but sets dontRetryParnerLogin
to true)dontRetryPartnerLogin === true
)dontRetryPartnerLogin === true
, so it doesn't retryI'll just make the code set dontRetryPartnerLogin
back to false
after login succeeds.
I guess this one closed too... Will wait for confirmation from @lovelydumpling
Got the new version installed, will let you know by tomorrow how it goes :)
by the way, the loop the bug was trying to fix was this:
...
I am able to play music this morning. It was still stopped at the end of whatever last song it was on, and the Skip/Play button didn't work, but clicking off the player and re-opening it and clicking Play/Skip started a new song, so I didn't have to restart the entire browser.
Speaking of, there's a possibly related but distinct (minor) issue, I think it needs its own page so I'll start it: #80
Edit: Gonna test again tonight with 2.2.0 now that the other issues have been resolved.
Edit 2: Mmk, the behavior is mostly unchanged. Where it's at right now:
I wake up, there's no music playing. I open the player, the last song that played is stopped at its end. I press play, nothing happens. I press Skip, it skips to another song, but it never starts playing. I close the player and reopen it, it has no song up. I click play once, nothing happens. I click it again, and it plays a new song.
Having the same issue here. Plays fine for just about 2 hours then stops. If I refresh chrome and hit play it starts playing again sometimes, other times it requires closing chrome out, then opening it and selecting anedidora again. Then it plays. This is on both the new and old interfaces. Other than that it seems to work OK.
Having the same issue here. Plays fine for just about 2 hours then stops. If I refresh chrome and hit play it starts playing again sometimes, other times it requires closing chrome out, then opening it and selecting anedidora again. Then it plays. This is on both the new and old interfaces. Other than that it seems to work OK.
To be clear, have you updated Anesidora to the latest version (2.2.x)? Because your issue sounds like the old original version of the issue from 2.1. As it stands now, music may stop after a while but we no longer have to restart or refresh Chrome to play again, but rather click play/skip, close and re-open the anesidora panel and click play/skip once or twice more.
Yes that is with 2.2.1 running on the latest version of Chrome.
Strange. I'm on 2.2.0, I'll update to 2.2.1 and see if I can reproduce the issue.
Edit: So far I'm unable to reproduce the issue, I don't have to restart/refresh the browser to be able to play music again. Perhaps there's something different between Chrome and Chromium browsers like Brave (which is what I use)?
Possibly. Google likes to play with everything all the time.
OK, after a couple days it is now working somewhat better, it still stops at around 2 hours, but now I can simply hit play a couple times or re-open the panel to get it working again.
Alright that's about where I'm at too.
OK if I'm correct it was something outside the extension, at least on mine it is now playing for at least 5 hours non-stop. I noticed that last night I started it around 01:00 and dozed off, woke up at 06:15 and it was still playing with no intervention.
OK if I'm correct it was something outside the extension, at least on mine it is now playing for at least 5 hours non-stop. I noticed that last night I started it around 01:00 and dozed off, woke up at 06:15 and it was still playing with no intervention.
I'm still having the issue. Wish I knew what fixed it for you.
Fixed by #94 ! It lasted the full night. About 10 hours. Should be able to close this issue now. (Although perhaps not until it's fixed in the Release.)
Released with https://github.com/pvrs12/Anesidora/releases/tag/v2.2.3
Working like it used to now, doesn't stop even after 20+ hours. OH and FYI it will also run on the Edge browser ! Tried it as a test. Then removed it and edge.... Thanks folks.
@lovelydumpling lovelydumpling commented
@hucario hucario commented yesterday
@lovelydumpling lovelydumpling commented 15 hours ago •
@hucario hucario commented 2 hours ago
Moved from #68