Opened 13 years ago
Closed 12 years ago
#2125 closed bug (Fixed)
Plugin method calls are missing when first enabling plugins in webui
Reported by: | Lilltiger | Owned by: | Damien Churchill |
---|---|---|---|
Priority: | minor | Milestone: | 1.3.6 |
Component: | Plugin | Version: | 1.3-stable |
Keywords: | label, webui | Cc: |
Description
In Deluge 1.3.3, 1.3.5 and the current git (1 Jul 2012)
one is unable to add labels using the Label plugin in the WebUI
unless you first open the gtk-ui and add a label.
The gtk-ui can be started as any user, it does not have to be the same user as the webui runs as, and the webui daemon does not even have to be restarted.
I have managed to reproduce this several times by unmerging (using gentoo/sabayon) and reinstalling deluge.
Change History (8)
comment:1 by , 13 years ago
Milestone: | Future → 1.3.6 |
---|---|
Owner: | set to |
Status: | new → assigned |
Version: | 1.3.5 → git 1.3-stable |
comment:2 by , 13 years ago
Because it happens on 1.3.3 that means that its not related to extjs 3.4 upgrade and when quickly testing the issue I found that restarting just deluged works so I think maybe a plugin core issue.
comment:3 by , 12 years ago
More testing has revealed that it affects other plugins (scheduler) as well and found another workaround is to reconnect to the daemon using Connection manager.
The main problem here is that remote methods stored in json_api _remote_methods
are only updated upon connecting to the daemon client.daemon.get_method_list
so therefore not updated when enabling the plugin after the webui has connected.
Not sure the best way to solve this issue.
comment:4 by , 12 years ago
Summary: | Issues with creating labels in WebUI → Plugin method calls are missing when first enabling plugins in webui |
---|
comment:5 by , 12 years ago
This seems to be working well for me. Also cleaned up a little bit of deferred weirdness which was unrelated.
Ninja edit: decided event registration should be on component start instead of init, moved the patch to github.
https://github.com/gazpachoking/deluge/compare/1.3-stable...1.3-stable-2125
comment:6 by , 12 years ago
The fix for #2046 means that need to refresh the browser is no longer required however this bug will resurface because the js code does not contain the updated list of methods. The quick and dirty fix is to do the following:
-
deluge/ui/web/js/deluge-all/Plugin.js
a b Deluge.Plugin = Ext.extend(Ext.util.Observable, { 77 77 */ 78 78 enable: function() { 79 79 this.fireEvent("enable", this); 80 if (this.onEnable) this.onEnable(); 80 if (this.onEnable) { 81 deluge.client.reloadMethods(); 82 this.onEnable(); 83 } 81 84 }, 82 85 83 86 registerTorrentStatus: function(key, header, options) {
The problem with this change is that by using reloadMethods
from Client.js
it deletes all the methods in list before updating. This results in undefined
errors when attempting to call deluge methods while webui is running until the list is repopulated.
I think this requires adding a new function to Client.js
that simply adds newly found methods to the list.
comment:7 by , 12 years ago
Fixed the issue Cas mentioned in this branch. Label plugin works fully right after enabling with no refreshes. There are some errors after plugins (at least label) are disabled, unsure if it's related.
comment:8 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in 1.3-stable: 782b39c90db, e865180e832
It fails due to deluge.client.label being undefined on line 79 of label.js Restarting deluge-web after enabling the plugin also fixes it. For some reason deluge.client.label isn't being created after enabling the plugin. Not sure if this is also due to the extjs upgrade...