PackageKit / PackageKit

A D-BUS abstraction layer that allows the user to manage packages in a secure way using a cross-distro, cross-architecture API.
https://www.freedesktop.org/software/PackageKit/
GNU General Public License v2.0
260 stars 164 forks source link

Authentication prompt is shown at the *end* of a major distro upgrade #760

Open Pointedstick opened 6 months ago

Pointedstick commented 6 months ago

STEPS TO REPRODUCE

  1. Launch Discover with a major distro upgrade available (handled by PackageKit)
  2. Click the "Upgrade to [distro version]" button
  3. Click on "Update all" button

OBSERVED RESULT The update starts downloading and takes a while. At the end of this process, I am shown an authentication dialog.

EXPECTED RESULT The authentication dialog should be shown at the beginning of the process, with credentials cached until the process completes.

ADDITIONAL INFORMATION Not a Discover-specific bug; you can reproduce this by doing the update using pkcon too.

sidt4 commented 6 months ago

Update All is for live updateable apps (flatpak / snap etc). That's totally different from Upgrade to .. button which is handled by packagekit.

Also, I don't think PackageKit requests authentication dialog for installing updates. That's the whole purpose of it. It should be non-interactive. But, it also depends on the PolKit policy rules installed by your distro.

Refer: https://github.com/PackageKit/PackageKit/tree/main/policy/

Pointedstick commented 6 months ago

The point is that if it's going to perform an action that might display a Polkit prompt (if the distro has polkit set up that way) it should do this at the beginning of the process, rather than in the middle or at the end.

sidt4 commented 6 months ago

Personally I think it's a bad idea to cache the auth credentials for too long. But, it will be Matt's call to make.

Which distro was this on ?

Pointedstick commented 6 months ago

Fedora KDE.

sidt4 commented 6 months ago

It appears offline upgrade does need admin authentication. Refer https://github.com/PackageKit/PackageKit/blob/main/policy/org.freedesktop.packagekit.policy.in#L270-L284

I use Debian Unstable, so never encountered distro upgrades.

rasa commented 4 months ago

Or at the very least, a popup message that says "Please wait..." between the time you click "Update All", and the password prompt appears, so the user knows not to toggle away.