Ephellon / Twitch-Tools

Adds extra features to Twitch
https://chrome.google.com/webstore/detail/ttv-tools/fcfodihfdbiiogppbnhabkigcdhkhdjd
GNU General Public License v3.0
20 stars 2 forks source link

Issue: Endless Tab Looping with Slow Connections or Slow Loading #18

Open P-rox-y opened 10 months ago

P-rox-y commented 10 months ago

Describe the bug When Twitch streams are initiated under slow connections, key modules fail to load. Twitch Tools, after waiting about 30 seconds (varies), tries to resolve this by opening another tab for the unresponsive stream. This can lead to a loop where new tabs are continually opened if they don't load promptly, especially since original unresponsive tabs aren't closed. It's unclear if Twitch Tools is waiting for all Twitch modules to load or just its own before this retry mechanism triggers.

To Reproduce

  1. Open multiple streams with a slow connection, or expended loading times. (Alternative way to reproduce; you can open multiple streams very quickly and you should see same issue occur)

Expected behavior Be able to launch multiple streams quickly and have them load Twitch Tools normally even if the browser is taking a longer than normal/average amount of time to finish loading each stream either due to slow internet connection or slow loading times due to the amount of streams being launched quickly.

Screenshots If having issues reproducing the problem, I can see if I can get a recording of it happening on request.

Extension Information

Additional comments Possible suggested fixes:

Ephellon commented 10 months ago

It waits for key modules to load. I have an update that removes a few of them. I've been having similar issues 😊

Ephellon commented 10 months ago

See if v5.32.10 mitigates the issue. If it continues to reload, go to the settings page and check the console (F12 or Right Click → Inspect)

Ephellon commented 10 months ago

Allow users to adjust or disable the timeout leading to the auto-reload function.

  • Maybe feasible. As the logic is used in the background ("backend") portion, the setting(s) might not load properly

Close original tabs before opening new ones.

  • This is what it's intended to do currently... v5.32.10 no longer waits for a response to force a close

Notify users when slow load or failure occurs, offering action choices.

  • Feasible. Would need to add logic to detect failed modules and disable them until the user either enables them or is no longer experiencing slowed speeds

Set a max retry limit to avoid endless looping.

  • Feasible. Would limit it to one retry as to not hinder the user any further

Focus on reloading only malfunctioning modules instead of entire pages.

  • Already used (to a degree) since v2.9. Some modules are required for the rest of the extension to run smoothly. Usage: RestartJob(JobName:string, Reason:string) → undefined

Check if original tabs are still active before opening new ones.

  • Already used. The LAG_REPORTER (primary), GALLOWS_CHECKER (controlled by LAG_REPORTER) ping each Twitch tab and (upon receiving no response) will duplicate and destroy the offending tab. The TabWatcherInterval (independent) will check (and correct) if any tab is frozen or offline.

Optimize module loading and use caching for better performance.

  • The modules that cause the issue do not load any data other than the user's settings
Ephellon commented 10 months ago

Leaving myself notes

P-rox-y commented 10 months ago

Version 5.32.10 shows significant improvement on the tab looping.

While I can still replicate the issue under extreme conditions (testing using the alternative method of launching multiple streams quickly [20+]) , it tends to resolve and exit the loop much quicker than in 5.32.9 though I'm sure this would vary by connection/processing speed of each user.

If you're still interested, I'll see if I can gather some logs tomorrow to continue this ticket.

Ephellon commented 8 months ago

When I get time I want to implement a few of the aforementioned features. I think it would be helpful to see what didn't load and have a button popup asking if the user wants to retry loading the module(s).