Skip to content

(updater): typing the admin password for a .deb update is interrupted by a not-responding dialog #475

Description

@jbr-sekoia

Symptom

On Ubuntu with the .deb install, Restart to update opens the system authentication dialog for the admin password. While the password is being typed, GNOME shows "Switchboard is not responding" over it and the focus jumps to that dialog, repeatedly. Once the password is accepted the update goes through and the app recovers.

Cause

  • updater-install (main.js:3104-3109) calls autoUpdater.quitAndInstall() with the windows still mapped.
  • On a .deb, electron-updater 6.8.9 installs before quitting. BaseUpdater.quitAndInstall runs install(), then app.quit(). DebUpdater.doInstall runs dpkg -i through LinuxUpdater.runCommandWithSudoIfNeeded, which wraps it in pkexec (the first of gksudo, kdesudo, pkexec, beesu found) via spawnSyncLog, a synchronous spawn (node_modules/electron-updater/out/LinuxUpdater.js:34-51, DebUpdater.js).
  • The main process is therefore blocked for as long as the polkit dialog is open. Its windows stop answering the compositor's ping, and mutter raises the "not responding" dialog, which takes the focus.

Wanted

Typing the password is not interrupted: no "not responding" dialog while the authentication prompt is open, and the update then completes and relaunches as today.

Directions to weigh in the specification

  1. Unmap or destroy every window before calling quitAndInstall on Linux. The blocked process then has no window to ping. This is the smallest change. Measure whether a hidden window is still pinged.
  2. Install outside the blocked process. On quit, start a detached helper that runs pkexec dpkg -i <file> and relaunches the app; then the app exits at once. The app is gone while the password is typed, at the cost of owning the install step that electron-updater does today.

What must hold either way:

  • The unsaved-edits guard (unsavedGuard.confirmQuit) still runs before anything is hidden.
  • The ActivityWatch flush still runs.
  • A cancelled authentication (pkexec exit 126) leaves the app running with its windows back. Today electron-updater dispatches an error in that case and the app stays open.
  • AppImage, Windows and macOS updates are unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions