Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rSpeedGraph is not defined #2478

Open
3 tasks done
buggsi opened this issue Apr 10, 2023 · 23 comments
Open
3 tasks done

rSpeedGraph is not defined #2478

buggsi opened this issue Apr 10, 2023 · 23 comments
Labels

Comments

@buggsi
Copy link

buggsi commented Apr 10, 2023

Please complete the following tasks.

  • Web browser cache cleared
  • Link provided to install script if applicable
  • Web browser, ruTorrent, PHP and OS version provided

Tell us about your environment

Web Browser: Waterfox Classic and Chrome
ruTorrent: v4.1-beta.4
PHP: PHP 7.4.3
OS: Alpine 3.14

Tell us how you installed ruTorrent

rtorrent master
libtorrent master
rutorrent v4.1-beta.4

https://github.com/romancin/rutorrent-docker/tree/develop

Describe the bug

On Waterfox Classic, the webui is stuck on the loading screen:
Clipboard Image

On Chrome, the webui loads, the torrents are listed on the right panel, but the states are zeroed,
image

Also, with this repeating error in the log:
2023-04-10 14:54:36] JS error: [http://***:***@******:91/js/webui.js?v=410 : 2184] Uncaught TypeError: Cannot read properties of undefined (reading 'includes')

Steps to reproduce

No response

Expected behavior

No response

Additional context

No response

@stickz
Copy link
Collaborator

stickz commented Apr 10, 2023

Please clear your web browser cache. The development branch doesn't clear it for you. It looks like webui.js is still cached.

@buggsi
Copy link
Author

buggsi commented Apr 10, 2023

I already cleared the cache, even started new instances of the browsers with clean profiles, I still get the same errors.

@stickz
Copy link
Collaborator

stickz commented Apr 10, 2023

Do you have any custom plugins installed that are not distributed with ruTorrent? We changed the speed graph to the point where it may cause breakage in version 4.1. The old speed graph couldn't scale with thousands of torrents.

@buggsi
Copy link
Author

buggsi commented Apr 10, 2023

There is a plugin called speedgraph, I tried disabling it (and clearing the cache again), to no avail.

image

The extra plugins installed are in the Dockerfile https://github.com/romancin/rutorrent-docker/blob/develop/Dockerfile if you got time to look at them.

@stickz
Copy link
Collaborator

stickz commented Apr 10, 2023

I looked at your docker file. Almost all of these plugins on Line 131 are not compatible with version 4.
https://github.com/romancin/rutorrent-docker/blob/develop/Dockerfile#L131

The repo of plugins you've installed are nine years old and not updated for version 4.
https://github.com/Ac3sRwild/ruTorrent-plugins

@buggsi
Copy link
Author

buggsi commented Apr 10, 2023

I rebuilt with non-master rtorrent v0.9.8/libtorrent v0.13.8, while removing those plugin lines from Dockerfile, restarted the container, disabled all plugins, cleared cache. Still the same issue.
Of note, v4.0.4 worked fine with all the plugins before I started trying the 4.1 betas.

@stickz
Copy link
Collaborator

stickz commented Apr 10, 2023

Did you disable this plugin as well? git clone --depth 1 https://github.com/orobardet/rutorrent-force_save_session

Whether or not these errors went undetected are unknown. But lines this like will throw an error when they run on v4.0.4.
cachedEcho('{"status":'.$g_nFSS_Status.',"error":"'.$g_sFSS_Error.'","msg":"'.$g_sFSS_Msg.'"}',"application/json");

It should be like this instead. This is one of many examples of compatibility issues.
CachedEcho::send('{"status":'.$g_nFSS_Status.',"error":"'.$g_sFSS_Error.'","msg":"'.$g_sFSS_Msg.'"}',"application/json");

@buggsi
Copy link
Author

buggsi commented Apr 10, 2023

Yes all the # ruTorrent plugins section in the Dockerfile was removed. I started a clean instance of rutorrent-docker, then added a torrent to it and it seems to work. I guess there's something in the v4.0 configs that is conflicting with v4.1. I'll investigate.

@stickz
Copy link
Collaborator

stickz commented Apr 10, 2023

@TrimmingFool Are these lines of code compatible with version 4.1? The way they are implemented?

https://github.com/Novik/ruTorrent/blob/develop/plugins/theme/themes/Excel/init.js#L39-L45

plugin.speedCreate = rSpeedGraph.prototype.create;
rSpeedGraph.prototype.create = function( aOwner )
{
	plugin.speedCreate.call(this,aOwner);
	this.gridColor = "#034084";
	this.backgroundColor = "#ffffff";
}

https://github.com/Novik/ruTorrent/blob/develop/js/webui.js#L236
speedGraph: new rSpeedGraph(),

@buggsi
Copy link
Author

buggsi commented Apr 10, 2023

@stickz can you test on Waterfox Classic, or Firefox? Whatever I do, the rSpeedGraph is not defined persists, but on Chrome I can get things to run on a clean rutorrent-docker.

@stickz
Copy link
Collaborator

stickz commented Apr 10, 2023

@stickz can you test on Waterfox Classic, or Firefox? Whatever I do, the rSpeedGraph is not defined persists, but on Chrome I can get things to run on a clean rutorrent-docker.

Try deleting WebUISettings.dat in /share/settings. I suspect this problem is caused by changing a web interface setting.

@stickz
Copy link
Collaborator

stickz commented Apr 10, 2023

This would explain why it works on Chrome but not Firefox. Firefox may be treating new rSpeedGraph() as a critical error.

@buggsi
Copy link
Author

buggsi commented Apr 11, 2023

After many testing on Chrome (since Firefox is borked), I found that newly added torrents are fine, but restoring session files from v4.0 session folder (*.torrent *.torrent.libtorrent_resume and *.torrent.rtorrent files) result in the JS error: [http://*******/js/webui.js?v=410 : 2184] Uncaught TypeError: Cannot read properties of undefined (reading 'includes'). I have a feeling it's not the old plugins that are problematic, but the old session files.

@stickz
Copy link
Collaborator

stickz commented Apr 11, 2023

After many testing on Chrome (since Firefox is borked), I found that newly added torrents are fine, but restoring session files from v4.0 session folder (*.torrent *.torrent.libtorrent_resume and *.torrent.rtorrent files) result in the JS error: [http://*******/js/webui.js?v=410 : 2184] Uncaught TypeError: Cannot read properties of undefined (reading 'includes'). I have a feeling it's not the old plugins that are problematic, but the old session files.

Could you git clone develop to verify this problem is resolved? Afterwards, I'll create a new release.
git clone -b develop https://github.com/Novik/ruTorrent

@buggsi
Copy link
Author

buggsi commented Apr 12, 2023

@stickz we have a lift off on Chrome.

image

Also, it takes 2 seconds to load the webui, it's pretty fast. Previously it would take 5-6 seconds, as described in this issue #2427. It's not even necessary to set $cachedPluginLoading = true; in the config.php.

This current setup is with the master branches of rtorrent and libtorrent, and the develop of rutorrent. Docker image was built without the old AceP1983 plugins. I have several instances running (for different trackers) and their torrents loaded/migrated fine from v4.0.4 to develop

P.S. Also tested Firefox and Microsoft Edge in a Windows 10 sandbox, they both work. It's Waterfox Classic that is still stuck with the rSpeedGraph error.

@stickz
Copy link
Collaborator

stickz commented Apr 12, 2023

Also, it takes 2 seconds to load the webui, it's pretty fast. Previously it would take 5-6 seconds, as described in this issue #2427. It's not even necessary to set $cachedPluginLoading = true; in the config.php.

If the disk becomes loaded, it will take much longer. $cachedPluginLoading = true is a way to avoid this issue. You can limit the duration to three hours (default) to give some benefit and mitigate any potential caching problems.

Since you have a docker container an alternative solution would be to use vmtouch. It's more stable, but harder to setup.

This current setup is with the master branches of rtorrent and libtorrent, and the develop of rutorrent. Docker image was built without the old AceP1983 plugins. I have several instances running (for different trackers) and their torrents loaded/migrated fine from v4.0.4 to develop

Sound good. One additional tip. I would recommend using curl instead of libwww for xmlrpc. There are significant performance issues with thousands of torrents. It hammers the hard drive and slows down torrent distribution. curl is faster and more stable.

P.S. Also tested Firefox and Microsoft Edge in a Windows 10 sandbox, they both work. It's Waterfox Classic that is still stuck with the rSpeedGraph error.

There are no plans to support a beta version of a web browser. I'm going to close this issue since the problem is resolved. Please free to create anther issue, if you find additional problems. We greatly value your feedback and ability to test things thoroughly!

@stickz stickz closed this as completed Apr 12, 2023
@buggsi
Copy link
Author

buggsi commented Apr 12, 2023

Indeed I'm using curl. Waterfox Classic is not a beta by the way, it's a browser that supports legacy Firefox addons. I would use Firefox but sadly many of the legacy addons don't work on it anymore and don't have any alternatives. I really hope you guys can fix this rSpeedGraph issue. Thanks for the effort.

@buggsi
Copy link
Author

buggsi commented Apr 12, 2023

One last request, is it possible to make the speed graph optional in the config.php? I don't even use it to begin with. By disabling it, I can have a workaround to the Waterfox Classic problem, if you don't have time to dig more into it. Thanks.

@stickz
Copy link
Collaborator

stickz commented Apr 13, 2023

One last request, is it possible to make the speed graph optional in the config.php? I don't even use it to begin with. By disabling it, I can have a workaround to the Waterfox Classic problem, if you don't have time to dig more into it. Thanks.

@TrimmingFool Is there any way we could make the speed graph modular in version 4.2, so it's not directly connected to the web interface? There are other plugin implements such as _Task or _Noty which are great examples.

I strongly agree with @buggsi that we should provide users with the option to disable this feature. The redundancy aspects would highly benefit the robustness of the web interface and it would give developers more control to further customize this feature.

@stickz stickz reopened this Apr 13, 2023
@Novik
Copy link
Owner

Novik commented Apr 13, 2023

@stickz
Try to see here - https://github.com/Novik/ruTorrent/blob/master/conf/access.ini
You may simple add 'showGraphTab' to the [tabs] section.
As example check, how 'showPluginsTab' is implemented.

@stickz
Copy link
Collaborator

stickz commented Apr 13, 2023

@Novik
I found a better way to do this. I can turn the speed graph into a new plugin. This will remove 300 lines of pollution from the web interface. It's only going to take 50 lines of code plus moving 250 lines from graph.js into a new init.js file.

When the plugin is disabled, the entire speed graph object plus tab will be deleted. Similar to how the trafic plugin works. It's much easier to disable a plugin than configure access.ini. Third party install scripts all prefer the plugin route when possible.

@TrimmingFool
Copy link
Contributor

@TrimmingFool Is there any way we could make the speed graph modular in version 4.2, so it's not directly connected to the web interface? There are other plugin implements such as _Task or _Noty which are great examples.

@stickz In my opinion, plugins are a great way to split up code ownership, not so much for modularity. An option/setting is easier to maintain than a plugin which is basically a patch/mod. It is true however, that webui.js is doing too much and should be split into smaller JavaScript modules and/or classes (for instance: into classes for peers,files,trackers, (speed) tabs).

@stale
Copy link

stale bot commented Oct 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants