Linux: the app freezes while the elevation dialog is open (spawnSync install)

Author: joevin-slq-doctoCreated Aug 18, 2026Updated Aug 18, 2026
  • Electron-Builder Version: 26.15.3 — the code below is quoted from master (27.0.0-alpha.7), where it is unchanged
  • Electron Updater (as-needed): 6.8.9 (and 7.0.0-alpha.6)
  • Node Version: the one bundled with Electron 42.5.0
  • Electron Version: 42.5.0
  • Platform & Target: Linux (Ubuntu 24.04, GNOME 46, Wayland), deb target — the same code path serves rpm and pacman
  • Debug Logs: nothing is logged; the symptom is the desktop marking the app as not responding while the elevation dialog is open

What happens

LinuxUpdater.runCommandWithSudoIfNeeded installs through spawnSyncLog (LinuxUpdater.ts#L37-L54), so the Electron main process is blocked for as long as the polkit dialog is open — that is, while the user is typing their password. The desktop notices the unresponsive process and offers to force-quit the app:

"App" is not responding — Force Quit / Wait

Timers cannot run either, so any app-side safety net around the install is frozen too.

Steps to reproduce

  1. Package an app with the deb target and install it (sudo dpkg -i app.deb).
  2. Publish a newer version and let the app download it.
  3. Call quitAndInstall() (or installPendingUpdateIfAvailable() on master).
  4. When the polkit dialog appears, wait ~15 s before typing the password.

Why it is not simply "make it async"

doInstall and install are documented as must be sync (because quit even handler is not async) (BaseUpdater.ts#L80-L83) — the constraint comes from installing inside the app.on("quit") handler.

That constraint does not cover the paths that matter here. On master, targets whose install requires elevation are already excluded from the automatic install at launch and go through an explicit installPendingUpdateIfAvailable() (BaseUpdater.ts#L52-L61), and quitAndInstall() is called by the application, not by a quit handler. Both can await an install. Only the on-quit path cannot — and there the app is exiting anyway, so blocking is far less harmful.

I have a patch for this and will open a PR shortly.

Source: electron-userland/electron-builder