Review of "Battery Session Timer" version 8

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 3

Shexli found 3 issues 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:581
    file.load_contents(null)
  • extension.js:608
    file.load_contents(null)
  • extension.js:672
    file.load_contents(null)

EGO-A-004 warning

extension files should not contain excessive ungated console logging

File contains 14 ungated console.log/warn/error calls (threshold: 5).

No excessive logging

  • extension.js:226
    console.warn(`Battery Session Timer: ошибка отключения сигнала UPower: ${error}`)
  • extension.js:332
    console.warn(`Battery Session Timer: logind недоступен, используется монотонный таймер: ${error}`)
  • extension.js:362
    console.warn(`Battery Session Timer: ошибка отключения сигнала logind: ${error}`)
  • extension.js:584
    console.warn(`Battery Session Timer: повреждён файл рекорда ${this._recordFile}`)
  • extension.js:662
    console.warn(`Battery Session Timer: не удалось удалить файл сессии ${this._sessionFile}: ${error}`)
  • extension.js:675
    console.warn(`Battery Session Timer: повреждён файл настроек ${this._settingsFile}`)
  • extension.js:257
    console.log(`Battery Session Timer: питание было подключено во время сна — сбрасываем сессию`)
  • extension.js:274
    console.log(`Battery Session Timer: заряд увеличился на ${chargeDiff}% (было ${this._resumedChargePercent}%, стало ${currentCharge}%) — сбрасываем сессию`)
  • extension.js:172
    console.error(`Battery Session Timer: не удалось подключиться к UPower: ${error}`)
  • extension.js:196
    console.error(`Battery Session Timer: не удалось получить DisplayDevice: ${error}`)

EGO-M-008 warning

extensions using unlock-dialog must document it in disable() comments

Extensions using `unlock-dialog` should document the reason in `disable()` comments.

Session Modes

  • extension.js:715
        disable() {
            if (!this._enabled)
                return;
    
            this._tracker.tick(this._nowUs());
            const state = this._tracker.snapshot();
            this._saveRecordIfDirty();
            this._saveSessionState(state);
            this._enabled = false;
    
            if (this._timeoutId)
             

All Versions

Previous Reviews on this Version

Gluk41 auto- rejected
Auto-rejected because of new version 9 was uploaded