Review of "Battery Session Timer" version 23

Details Page Preview

Battery session timer with record saving for GNOME Shell

Extension Homepage
https://github.com/Gluk41/battery-session-timer

No comments.

Diff Against

Files

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

Shexli (experimental) warning 1

Shexli found 1 issue that may need reviewer attention.

EGO-X-004 warning

extensions should avoid synchronous file IO in shell code

Shell code should avoid synchronous file IO APIs like `GLib.file_get_contents()` and `Gio.File.load_contents()`.

File Operations

  • extension.js:559
    file.load_contents(null)
  • extension.js:585
    file.load_contents(null)
  • extension.js:642
    file.load_contents(null)

All Versions

Previous Reviews on this Version

JustPerfection rejected
This code still doesn't follow our guidelines for best practices: https://gjs.guide/extensions/review-guidelines/best-practices.html Please don't send the code without reading.
Gluk41 posted a review
Hello. Thank you for your continued review and for pointing me to the best practices guide. I have carefully studied the GNOME Extension Best Practices and updated the code accordingly. The following issues have been fixed: Removed all unnecessary try-catch wrappers around methods that never throw exceptions (e.g., GLib.Source.remove(), disconnect()). Removed redundant optional chaining (?.()) and function type checks for guaranteed built-in methods. Removed the _enabled flag and rewrote the disable() method to perform a complete, unconditional cleanup of all resources. Reordered cleanup in disable() to follow the correct sequence: timeouts → signals → D-Bus watchers → widgets → nullification. Grouped timeout removal and creation together to ensure old timers are always properly removed before new ones are created. I have uploaded a new version (v8) for review. Please let me know if there are any remaining issues. Thanks again for your time and guidance.
Gluk41 posted a review
Hello. Thank you for your continued guidance. I have carefully read and followed the best practices. Here is what I fixed: Removed all _enabled flags and unconditional early returns from disable(). Removed all unnecessary try-catch wrappers around disconnect() and Source.remove(). Moved _proxyGeneration++ and _logindGeneration++ to the beginning of disable(). Grouped timeout removal and creation together in _setPosition(). Removed all if (!this._enabled) checks from callbacks and lifecycle methods. I have uploaded version 9 (v9) with all fixes. Please let me know if there is anything else. Thanks!
Gluk41 posted a review
Hello. Thank you for your patience and detailed feedback. I have carefully studied the GNOME Extension Best Practices and prepared a new version with all necessary fixes: Removed all unnecessary try-catch wrappers around guaranteed methods like disconnect() and Source.remove(). Removed redundant optional chaining (?.()) and function type checks. Removed the _enabled flag and rewrote the disable() method for complete, unconditional resource cleanup. Fixed the cleanup order in disable() to follow the recommended sequence: timeouts → signals → D-Bus watchers → widgets. Grouped timeout removal and creation together in _setPosition(). All changes are available in the latest release on GitHub: https://github.com/Gluk41/battery-session-timer/releases/tag/v1.0.3 I have also uploaded version 9 (v9) to EGO for review. Please let me know if there is anything else I need to fix. Thanks again for your time and guidance!