Twitch-Tools icon indicating copy to clipboard operation
Twitch-Tools copied to clipboard

Issue: Endless Tab Looping with Slow Connections or Slow Loading

Open P-rox-y opened this issue 1 year ago • 8 comments

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

  • Version: 5.32.9
  • Source: store
  • Browser: chrome
  • Operating System: Windows

Additional comments Possible suggested fixes:

  • Allow users to adjust or disable the timeout leading to the auto-reload function.
  • Close original tabs before opening new ones.
  • Notify users when slow load or failure occurs, offering action choices.
  • Set a max retry limit to avoid endless looping.
  • Focus on reloading only malfunctioning modules instead of entire pages.
  • Check if original tabs are still active before opening new ones.
  • Optimize module loading and use caching for better performance.

P-rox-y avatar Aug 10 '23 01:08 P-rox-y

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

Ephellon avatar Aug 10 '23 01:08 Ephellon

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 avatar Aug 10 '23 02:08 Ephellon

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 avatar Aug 10 '23 02:08 Ephellon

Leaving myself notes

Ephellon avatar Aug 10 '23 02:08 Ephellon

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.

P-rox-y avatar Aug 10 '23 04:08 P-rox-y

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).

Ephellon avatar Oct 21 '23 02:10 Ephellon

I occur this issue even when the stream is playing...

Mishasama avatar Aug 14 '24 07:08 Mishasama

Hi @Mishasama, this may occur if the tab does not respond to the backend's PING command. I will look into making the wait time a bit more lenient.

Ephellon avatar Aug 14 '24 14:08 Ephellon