Novik / ruTorrent

Yet another web front-end for rTorrent
Other
2.01k stars 408 forks source link

"TypeError: label is null" error when adding a torrent from a new tracker that hasn't been added to the list on the sidebar yet #2586

Closed GH0STDATA closed 10 months ago

GH0STDATA commented 10 months ago

Please complete the following tasks.

Tell us about your environment

Web Browser: Firefox 119.0 ruTorrent: v4.2.6 PHP: PHP 8.1.23 OS: Ubuntu 22.04.3 LTS

Tell us how you installed ruTorrent

https://github.com/crazy-max/docker-rtorrent-rutorrent

Describe the bug

As the title of the post describes, when adding a torrent from a new tracker that isn't already on the rutorrent sidebar, a JS type error occurs, and continues to occur every time you click or do an action on the page. It also looks like another bug happens in the GUI as well:

firefox_vUMA6VajNJ

The bug seems to go away once you refresh the page, but I figured I'd mention it here anyway.

Steps to reproduce

  1. Add a torrent from a tracker that isn't already listed in the sidebar.

Expected behavior

The tracker should be added to the sidebar with no error.

Additional context

No response

stickz commented 10 months ago

I got a stack trace from someone else regarding this bug. Adding it here for reference.


TypeError: label is null from theWebUI.updateLabel@https://?.d.itsby.design/rutorrent/ line 2 > injectedScript:7668:13
updateLabels@https://?.d.itsby.design/rutorrent/js/webui.js?v=426:2355:10
theWebUI.updateLabels@https://?.d.itsby.design/rutorrent/ line 2 > injectedScript:7685:22
theWebUI.rebuildTrackersLabels@https://?.d.itsby.design/rutorrent/ line 2 > injectedScript:7769:7
theWebUI.addTrackers@https://?.d.itsby.design/rutorrent/ line 2 > injectedScript:7609:12
Ajax/<@https://???.d.itsby.design/rutorrent/js/rtorrent.js?v=426:1301:22
c@https://???.d.itsby.design/rutorrent/js/jquery.js?v=426:2:25266
fireWith@https://???.d.itsby.design/rutorrent/js/jquery.js?v=426:2:26015
l@https://???.d.itsby.design/rutorrent/js/jquery.js?v=426:2:77721
send/o/<@https://???.d.itsby.design/rutorrent/js/jquery.js?v=426:2:80204
webui.js:3186:14
GH0STDATA commented 10 months ago

Thank you for the quick hotfix! I apologize about not posting a stack trace. Next time I report a bug, I will remember to do that.

stickz commented 10 months ago

Thank you for the quick hotfix! I apologize about not posting a stack trace. Next time I report a bug, I will remember to do that.

No problem. The fix from trimming fool is what resolves this problem properly. You can disable the track labels plugin until v4.2.8 is released. This will remove the JavaScript error. This plugin is not required. The functionality is trivial for most people.

GH0STDATA commented 10 months ago

No problem. The fix from trimming fool is what resolves this problem properly. You can disable the track labels plugin until v4.2.8 is released. This will remove the JavaScript error. This plugin is not required. The functionality is trivial for most people.

Gotcha, good to know. You're right, I create my own labels to separate torrents based on the tracker anyway, so that plugin is pretty redundant. I've disabled the tracklabels plugin as you suggested.

stickz commented 10 months ago

Resolved in v4.2.8.