vchlum / hue-lights

Gnome Shell extension for Philips Hue compatible lights controlled by the Philips Hue Bridge and for controlling Philips Hue HDMI sync box.
https://extensions.gnome.org/extension/3737/hue-lights/
MIT License
196 stars 14 forks source link

Can't open settings a second time #63

Closed ccope closed 1 year ago

ccope commented 2 years ago

I installed this extension a few days ago, but when I went to set it up I forgot I had to walk to the bridge to hit the button as part of the setup process. I was about to go to sleep so I quit the setup process and planned to do it later. But now I'm getting the following crash:

The settings of extension hue-lights@chlumskyvaclav.gmail.com had an error:

Error: Type name AddBridgeDialog is already registered

Stack trace:

registerGObjectType@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:542:50
registerWidgetType@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:92:39
_init/GObject.Object._classInit@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:515:33
_init/Gtk.Widget._classInit@resource:///org/gnome/gjs/modules/core/overrides/Gtk.js:75:31
registerClass@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:74:23
@/home/cam/.local/share/gnome-shell/extensions/hue-lights@chlumskyvaclav.gmail.com/prefs.js:59:33
_init@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:23:33
ExtensionPrefsDialog@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:10:4
OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:129:33
asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:115:22
run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:186:20
main@resource:///org/gnome/Shell/Extensions/js/main.js:22:13
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
start@resource:///org/gnome/gjs/modules/script/package.js:190:8
@/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17
vchlum commented 2 years ago

Hi @ccope ! Thank you for reporting. Could you please share your Linux and gnome versions?

Could you also try to open dconf-editor and remove all in path: /org/gnome/shell/extensions/hue-lights/. Let me know if it helped.

ccope commented 2 years ago

I'm using Gnome 42 on Ubuntu 22.04. dconf shows: Screenshot from 2022-11-06 17-56-49

So it does appear that I had partially associated with my Hue bridge before. Canceling that process probably didn't clean up the settings window correctly. I deleted the keys in this screenshot and tried disabling and re-enabling the extension, but it's still not working (I don't know if disabling extensions when using Wayland really does much though, since the window manager can't restart). I'm sure logging out and back in will resolve this, I just don't want to lose my session right now.

vchlum commented 2 years ago

I believe I know why it happened. A new version was released after your first attempt to add a bridge. Some objects from the previous version remain in the memory. I will maybe be able to change this behavior in general... I will investigate. For now, losing your session is the only way. I understand it is frustrating. I hope you will give a chance to this extension once you will relog:-).

ccope commented 2 years ago

I see, I figured maybe you could add some code to clean up incomplete setups. I did reboot yesterday and it works now though. Thanks for building this, it's very useful!

vchlum commented 2 years ago

I am glad it finally works. It concerns more objects than just setup-related... I will not close this issue. It will serve as a reminder for investigation. Currently, the extension update usually needs user relog. I think I can see why now;-) Once I will have time, I would try to improve.

vchlum commented 1 year ago

From what I checked, this is the gnome behavior. I can not fully resolve it. Sometimes it is necessary to relog on upgrade. I will close this now.