Skip to content

gs-update-monitor: Don’t cancel getting historical updates on startup

Shortly after startup (in an idle callback), gs-update-monitor.c calls GET_UPDATES_HISTORICAL to find out what (if any) updates were installed on boot, so that it can update the notification about system updates — whether they failed, were installed, or whether a large OS update was completed.

This only happens once, shortly after boot.

Previously, it was attached to the same GCancellable as used for updates. So if the system went into power saving mode shortly after boot, the GET_UPDATES_HISTORICAL call would be cancelled. This is bad for two reasons:

  1. The call would never be made again, so the updates notification would never be updated.
  2. get_updates_historical_cb() doesn’t check for G_IO_ERROR_CANCELLED, so would show the user an error message about software updates failing.

Fix this by adding a third cancellable, which is only cancelled at shutdown/dispose time, and use that for GET_UPDATES_HISTORICAL.

A following commit will ignore G_IO_ERROR_CANCELLED in get_updates_historical_cb().

Signed-off-by: Philip Withnall

Fixes: #1693 (closed)

Closes #1693 (closed)

Merge request reports