Review of "Shutdown Timer" version 37

Details Page Preview

Shutdown/reboot/suspend the device after a specific time or wake with a rtc alarm. The screen-saver will not interrupt the timer. A privileged control script may be installed to control shutdown and rtcwake as user.

Extension Homepage
https://github.com/Deminder/ShutdownTimer

No comments.

Diff Against

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

All Versions

Previous Reviews on this Version

Deminder posted a review
Link to GNOME 45 port the pull request: https://github.com/Deminder/ShutdownTimer/pull/9
JustPerfection rejected
1. Delaying disable is bad (line 91 extension.js) and that can get triggered after next enable. 2. Anything you save as `this.` in `ShutdownTimerPreferences` (prefs.js) can leave there after window close. Make them local of that method and pass them to other methods instead. 3. Move line 8-12 `modules/end-session-dialog-aware.js` to the `ESDAware.constructor()`. 4. What's the reason for line 15 `modules/util.js`? You can use `console.log()` without that condition. Same for line 22 in the same module.
Deminder posted a review
Thanks for the review. However, based on the points you provided, I do not understand the rejection: > 1. Delaying disable is bad (line 91 extension.js) and that can get triggered after next enable. When the gnome-shell switches from `user` -> `unlock-dialog` the extension is disabled and re-enabled by gnome-shell. Although, the timer could be restarted, the check command can not. I don't know a better way to handle this. For instance modifying this disable/enable behavior does not seem like a good idea. > 2. Anything you save as `this.` in `ShutdownTimerPreferences` (prefs.js) can leave there after window close. Make them local of that method and pass them to other methods instead. It is true that this seems cleaner. However, the `prefsObj` object is garbage collected when it goes out of scope after `fillPreferences` is called at `js/dbusServices/extensions/extensionPrefsDialog.js:36`. > 3. Move line 8-12 `modules/end-session-dialog-aware.js` to the `ESDAware.constructor()`. Are you sure that this is a good idea? In gnome-shell code `makeProxyWrapper` and `loadInterfaceXML` are never in the constructor. It seems to me as this is done this way because these functions are blocking. > 4. What's the reason for line 15 `modules/util.js`? You can use `console.log()` without that condition. Same for line 22 in the same module. In my test setup I override `globalThis.logDebug` for custom log behavior, it does not seem possible to override `console.log`. For the same reason `globalThis.logTest` existed but it is not used anymore (and I already removed it).
Deminder posted a review
> However, the `prefsObj` object is garbage collected when it goes out of scope after `fillPreferences` is called at `js/dbusServices/extensions/extensionPrefsDialog.js:36`. Oh, sorry, this is not true. Nevertheless I would appreciate clarification on the other points.
JustPerfection posted a review
# 1 That's how GNOME Shell rebasing in unlock dialog. Ask that on GNOME Matrix channel and maybe someone comes with a solution. # 2 You shouldn't leave any properties filled with instances there. one alternative is to clean up on window close request but I guess making them local is much easier. # 3 Yes they are blocking but in GResource. It doesn't block shell process. Still, it should still be in the `ESDAware.constructor()`. #4 Ok, please remove `logTest()` if you don't use it.