RaphaelRochet / arch-update

Update indicator for ArchLinux and Gnome-Shell
https://extensions.gnome.org/extension/1010/archlinux-updates-indicator/
GNU General Public License v3.0
229 stars 69 forks source link

Timer is reset on lock/unlock preventing automatic checks if locked often #234

Closed Saroumane closed 1 month ago

Saroumane commented 5 months ago

Arch Linux Update Indicator 61 Gnome 46 Archlinux

I come back to Gnome after a few months with KDE, and I try to use again this gnome-extension. Strangely, everything works (Check now, Update) except it never "auto-checks". I tried different interval values (30 min, 1440min) I tried to enable or disable the "disable output parsing" option. The command to check for updates is /usr/bin/checkupdates and it works normally if I trigger it manually ("Check now")

What should I do ?

RaphaelRochet commented 5 months ago

That's a first ...

Do you have anything related to arch-update in logs ? Maybe in journalctl -g "JS ERROR"

Saroumane commented 5 months ago

When I open "Settings" window of the extension I have always :

systemd[59110]: Started dbus-:1.2-org.gnome.Shell.Extensions@12.service.
gjs[52233]: Unknown key gtk-modules in /home/user/.config/gtk-4.0/settings.ini 

I got rid of this warning by commenting the offending line. (Probably a remnant of KDE)

I also sometimes get (while using the Settings window) :

gnome-shell[335010]: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
                                               _promisify/proto[asyncFunc]@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:448:16
                                               openExtensionPrefs@resource:///org/gnome/shell/ui/extensionSystem.js:320:26
                                               openPreferences@resource:///org/gnome/shell/extensions/extension.js:27:26
                                               _openSettings@file:///home/user/.local/share/gnome-shell/extensions/arch-update@RaphaelRochet/extension.js:209:19
                                               activate@resource:///org/gnome/shell/ui/popupMenu.js:195:14
                                               _init/<@resource:///org/gnome/shell/ui/popupMenu.js:112:24
                                               @resource:///org/gnome/shell/ui/init.js:21:20

I have seen some people have /bin/sh -c "/usr/bin/checkupdates" instead of /usr/bin/checkupdates

I'll try this, even if it should be the same result.

Saroumane commented 5 months ago

It seems to work now. I don't really understand why, because my SHELL variable is "/bin/bash" and /bin/sh is symlinked to bash ...

Saroumane commented 5 months ago

False alert, it still does not work as expected. I have "interval between check" on 30 min, and it looks like it worked once this afternoon, while I was using the PC.

Could it be that when the screen is locked, the autocheck is not performed ? Can I enable some detailed logs somewhere ?

Edit : I just checked another gnome-extension (GSConnect) recently updated, and guess what : image

So I'm assuming that "by default", gnome-extensions are not active while the screen is locked. Ideally, I'd like to set "interval between check" to 1440min (24 hours), and I'd like that the check would be done even if my screen is locked.

RaphaelRochet commented 5 months ago

Indeed. Extension is disabled when screen is locked.

Saroumane commented 5 months ago

I assume you consider it's not a bug. But could it be a new feature ? (See my use case above)

RaphaelRochet commented 5 months ago

Doing checks when screen is locked (meaning keep the extension active) I won't do.

But you found an edge case that require fixing nonetheless. Each time you lock your screen, the timer is restarted. So if you lock you screen often, then the only check you'll ever have is the first one on login. I will fix that. Also, I see another thing (less annoying but still) : when you change the check interval in settings, the timer is reset.

RaphaelRochet commented 1 month ago

Next version should behave way better ;) Thanks again, this is a nice quality improvement :+1: