Bug 439050 - Discover unnecessarily checks for updates again after opening via notifier
Summary: Discover unnecessarily checks for updates again after opening via notifier
Status: CONFIRMED
Alias: None
Product: Discover
Classification: Applications
Component: PackageKit (show other bugs)
Version: 5.22.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-23 08:09 UTC by Alex
Modified: 2023-01-12 18:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
pkmon output (3.10 KB, text/plain)
2021-07-20 07:21 UTC, Alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2021-06-23 08:09:26 UTC
When I log in to my session, often there are updates available. The notifier tells me this, and in order for it to know there are available updates, it must check. But, when opening Discover via the notifier, it seems to go through the whole process of checking for updates again, even though it just did that to display that notification to me. It seems unnecessary, and it takes like >30s for it to actually display what updates are available.
Comment 1 Alex 2021-06-23 08:17:40 UTC
Actually, I'm not sure if it even performs a full check. Just after running a system update, it tells me that there are updates available again. I check which ones its talking about, and its all updates that I have just installed. I click Refresh, wait a few minutes for it to complete (mostly packagekit-backend takes up that time), and then it says my system is up to date.
Comment 2 Alex 2021-06-23 14:58:57 UTC
I think part of this is related to https://bugs.kde.org/show_bug.cgi?id=438670
Comment 3 Aleix Pol 2021-07-06 14:56:51 UTC
As you can see here:
https://invent.kde.org/plasma/discover/-/blob/master/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp#L101

We only download updates if the cache is over 1h old. So it sure should not take a few minutes.

Maybe you could help providing a pkmon log?
Comment 4 Alex 2021-07-20 07:21:03 UTC
(In reply to Aleix Pol from comment #3)
> As you can see here:
> https://invent.kde.org/plasma/discover/-/blob/master/libdiscover/backends/
> PackageKitBackend/PackageKitBackend.cpp#L101
> 
> We only download updates if the cache is over 1h old. So it sure should not
> take a few minutes.
> 
> Maybe you could help providing a pkmon log?

I think that's kind of the issue, the update cache can be outdated while the updates available notifier is still there. I think it should be only ever checking in the background, and doing so hourly, or some given period of time, instead of checking when the user clicks and opens Discover. I'm on Fedora so having the GUI blocked by refreshing the cache means waiting on the pk backend for a long time, but I think purely background refreshes would avoid this.

The pkmon log I'm about to attach is from the very start of the session, before wifi connection is established, so it includes the notifier appearing. After that, I click on the notifier to open Discover, and wait for it to load fully.
Comment 5 Alex 2021-07-20 07:21:29 UTC
Created attachment 140206 [details]
pkmon output
Comment 6 Nate Graham 2021-08-04 18:35:04 UTC
Refreshing takes only a few seconds for me on Fedora FWIW.
Comment 7 Aleix Pol 2022-11-28 20:49:53 UTC
Git commit d38e7ad9f2aeb69127b6e62ac50f655077d26e1c by Aleix Pol.
Committed on 28/11/2022 at 20:48.
Pushed by apol into branch 'master'.

flatpak: Do not check for updates immediately

Wait for a bit to check for updates, instead just show the locally
available data ASAP.
Related: bug 433587

M  +14   -5    libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
M  +2    -1    libdiscover/backends/FlatpakBackend/FlatpakBackend.h

https://invent.kde.org/plasma/discover/commit/d38e7ad9f2aeb69127b6e62ac50f655077d26e1c