Skip to content

Fix prompt for updates on end session dialog

Michael Catanzaro requested to merge mcatanzaro/#2276 into master

I'm really rusty and this is probably barf, but it's ready for initial review. I left some debug logs left-indented, which you can ignore. And there are two FIXMEs that I'll need to solve before removing WIP status. Maybe somebody has a better solution than this weird hack, though?

Since PackageKit 1.11.1, the prompt to install updates on the end session dialog has been (mostly) broken. The problem is that it only works if PackageKit is running at the time the end session dialog is opened; otherwise, our GDBusProxy has invalidated all of its properties, which we read to see if update is possible. We need to autostart PackageKit before reading its properties to fix this problem. That would be easy if we were calling a method to see if an update or distro upgrade were available, but since we're just checking a property, there's not really an obvious non-hackish way to do it. So I came up with this yucky hack: we can ping PackageKit, which will autostart it, then wait for it to update its properties. (The properties are not updated before we receive the reply to its ping.)

The timeout is created to ensure that we don't fail to show the dialog if PackageKit responds to the ping but fails to update its properties in a reasonable amount of time. It's yucky, but we should be robust to that possibility.

Fixes #2276 (closed)

Edited by Michael Catanzaro

Merge request reports