Bug 466693 - Discover checks for updates daily, regardless of the frequency set in the Software Sources dialog.
Summary: Discover checks for updates daily, regardless of the frequency set in the Sof...
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: Notifier (show other bugs)
Version: 5.27.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on: 419055
Blocks:
  Show dependency treegraph
 
Reported: 2023-03-02 06:15 UTC by Alex
Modified: 2024-07-31 22:53 UTC (History)
13 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2023-03-02 06:15:04 UTC
+++ This bug was initially created as a clone of Bug #419055 +++

SUMMARY
Even when the user sets a lower frequency of automatic updates (e.g. weekly) in the Software Sources dialog, Discover nevertheless checks for updates daily. This means that effectively the user has no control over automatic update frequency.

STEPS TO REPRODUCE
1. In Discover, click on "Sources" -> "Software Sources". Provide the password if required.
2. In the "Software Sources" dialog that opens, click on "Updates". Make sure the "Check for updates" checkbox is checked, and choose a frequency other than "Daily" (e.g. "Weekly") in the corresponding dropdown. Click on "Close".

OBSERVED RESULT
Update notifications appear in the notifications area multiple times a week, presumably on every startup if updates are available.

EXPECTED RESULT
Update notifications appear at most once a week.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.2.1-arch1-1 (64-bit)
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8



ADDITIONAL INFORMATION
SUMMARY
Even when the user sets a lower frequency of automatic updates (e.g. weekly) in the Software Sources dialog, Discover nevertheless checks for updates daily. This means that effectively the user has no control over automatic update frequency.

STEPS TO REPRODUCE
1. In Discover, click on "Sources" -> "Software Sources". Provide the password if required.
2. In the "Software Sources" dialog that opens, click on "Updates". Make sure the "Check for updates" checkbox is checked, and choose a frequency other than "Daily" (e.g. "Weekly") in the corresponding dropdown. Click on "Close".

OBSERVED RESULT
Update notifications appear in the notifications area multiple times a week.

EXPECTED RESULT
Update notifications appear at most once a week.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 19.10
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION
This is a follow up to bug 401810 (Phabricator patch D17375) and bug 337752. Unfortunately, it appears that the issue wasn't resolved (at least not on my system).

My analysis shows that Discover's PackageKitNotifier attempts to check the frequency set in software-properties by running "apt-config dump" and looking for the "Apt::Periodic::Update-Package-Lists" property in its output. However, on my system the property name starts with uppercase "APT" rather than "Apt", and ends with a semicolon. Therefore PackageKitNotifier fails to find the correct property value, and falls back to the default of a daily check.
Comment 1 Paul Worrall 2023-03-02 13:37:15 UTC
Confirmed.  The setting seems to have been moved to System Settings -> Software Update

OBSERVED RESULT
For me it's set to "Weekly".  
The notifier told me updates were available so I installed them and rebooted, then the notifier came up again within a few hours

EXPECTED RESULT
After installing some updates, the notifier doesn't come up again until the selected period has expired (maybe an exception should be made for security updates)
Comment 2 Paul Worrall 2023-03-02 14:08:01 UTC
P.S. I'm on KDE Neon User edition, v5.27, with no Snaps or Flatpaks installed
Comment 3 Aleix Pol 2023-03-31 00:12:06 UTC
What output do you get for "apt-config dump"? Asking specifically for "Apt::Periodic::Update-Package-Lists"
Comment 4 Paul Worrall 2023-03-31 09:19:38 UTC
paul@neon-user:~$ apt-config dump|grep -i Periodic
paul@neon-user:~$ 

i.e. that config item isn't set
Comment 5 Aleix Pol 2023-03-31 15:53:25 UTC
That's the setting that Software Sources sets and where Discover looks for it. We cannot follow a setting that doesn't exist. :(
Comment 6 Paul Worrall 2023-03-31 22:58:56 UTC
I'm using the  "kcm_updates" KCM to change the value of "Notification Frequency"; that setting isn't in the Software Sources section of Discover.

The value I set is remembered between invocations, but it does not ask for a password or set "Apt::Periodic::Update-Package-Lists" and it does not seem to affect the frequency of update notifications.
Comment 7 Alexey 2023-08-03 15:38:47 UTC
Can I add here that I have the same bug in Fedora which uses dnf as a package manager instead of apt? Or should I create a new bug?
Comment 8 Nate Graham 2023-08-03 15:59:54 UTC
I think that's probably the same bug.
Comment 9 Anish 2023-10-05 09:47:25 UTC
Same issue in Fedora - KDE.

Cant even find the option "Check for updates" to uncheck in mine.

Discover 5.27.8
KDE Framework 5.109.0
Qt 5.15.10
Comment 10 Franz Trischberger 2024-04-06 17:53:35 UTC
Same issue here on opensuse tumbleweed with plasma 6.0.3.
I've set it to weekly but discover comes up daily.
Previously I had discover deinstalled+blacklisted, update to plasma6 ignored that blacklistingand installed it again.
I always manually updated the system, but wanted to give discover a chance.
Comment 11 Franz Trischberger 2024-04-07 13:23:58 UTC
https://invent.kde.org/plasma/discover/-/blob/master/notifier/DiscoverNotifier.cpp#L128
if (earliestNextNotificationTime.isValid() && earliestNextNotificationTime > QDateTime::currentDateTimeUtc()) {
        return false;
    }

Just an idea. In case earliestNextNotificationTime is NOT valid an updat notification is triggered.
Played with python:

>>> from PyQt6.QtCore import QDateTime
>>> c = QDateTime.fromString("2024,4,7,12,36,49.994")
>>> c.isValid()
False

I could not figure out in a reasonable amount of time how this whole kconf thing works and how it reads/writes DateTime objects, so this might turn out to be wrong.
Comment 12 TomK 2024-06-15 08:27:21 UTC
This still doesn't work with KDE 6.0.5 (Fedora if that matters)
Comment 13 Khanich 2024-07-21 03:58:27 UTC
Are we talking here about just the SystemTray icon or also about notifications (as in these small windows which pop up)?
Comment 14 Bug Janitor Service 2024-07-27 09:40:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/886
Comment 15 Thomas Duckworth 2024-07-27 09:44:52 UTC
(In reply to Khanich from comment #13)
> Are we talking here about just the SystemTray icon or also about
> notifications (as in these small windows which pop up)?

I opened a MR that makes the tray icon follow the notification icon timing, because I am pretty sure that's what people are complaining about.

Even if not, it is confusing behaviour anyway.
Comment 16 Khanich 2024-07-27 17:47:39 UTC
(In reply to Thomas Duckworth from comment #15)
> (In reply to Khanich from comment #13)
> > Are we talking here about just the SystemTray icon or also about
> > notifications (as in these small windows which pop up)?
> 
> I opened a MR that makes the tray icon follow the notification icon timing,
> because I am pretty sure that's what people are complaining about.
> 
> Even if not, it is confusing behaviour anyway.

That's why I asked because I would have done this too, if that's the problem.
Comment 17 Aleix Pol 2024-07-30 22:46:29 UTC
Git commit f98a9e3fd6ad44e1ace8ba436918afa918297a2c by Aleix Pol Gonzalez, on behalf of Thomas Duckworth.
Committed on 30/07/2024 at 22:42.
Pushed by apol into branch 'master'.

Only show the tray notifier on next notification time

This makes it follow the behaviour of the updates notification. It will only appear once per the timeframe specified in the KCM.

M  +4    -4    notifier/DiscoverNotifier.cpp
M  +2    -2    notifier/DiscoverNotifier.h
M  +5    -0    notifier/NotifierItem.cpp

https://invent.kde.org/plasma/discover/-/commit/f98a9e3fd6ad44e1ace8ba436918afa918297a2c