Bug 449563 - System Settings Quick Settings page shows same "Most Used" item twice
Summary: System Settings Quick Settings page shows same "Most Used" item twice
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: Quick Settings (show other bugs)
Version: 5.24.3
Platform: Other Linux
: HI normal (vote)
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
: 450972 451922 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-03 16:04 UTC by Schlaefer
Modified: 2022-08-24 13:56 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25.5


Attachments
System Settings most used shows same module twice (413.40 KB, video/x-matroska)
2022-02-03 16:04 UTC, Schlaefer
Details
System Settings most used shows same module twice (246.01 KB, video/x-matroska)
2022-02-03 16:07 UTC, Schlaefer
Details
sqlite3 ResourceEvent and ResourceScoreCache output (42.76 KB, text/plain)
2022-05-02 06:47 UTC, Schlaefer
Details
Still reproducing (28.75 KB, image/jpeg)
2022-07-24 17:11 UTC, Nate Graham
Details
duplicated module audio (10.95 KB, image/png)
2022-07-25 08:17 UTC, Pawel
Details
resourceEvent (10.37 KB, text/plain)
2022-07-25 08:17 UTC, Pawel
Details
ResourceScoreCache (76.55 KB, text/plain)
2022-07-25 08:18 UTC, Pawel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Schlaefer 2022-02-03 16:04:17 UTC
Created attachment 146230 [details]
System Settings most used shows same module twice

SUMMARY

The "Most Used Settings" shows same item twice.

STEPS TO REPRODUCE

1. Open System Settings
2. Have my setup and System Settings usage behavior

OBSERVED RESULT

"Display Configuration" is shown twice for me.

See attached video.

EXPECTED RESULT

Display Configuration module should only be displayed once.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.4-242-tkg-cacule (64-bit)
Graphics Platform: Wayland
Processors: 12 × 11th Gen Intel® Core™ i5-11400 @ 2.60GHz
Memory: 31,2 GiB of RAM
Graphics Processor: AMD Radeon RX 5500 XT
Comment 1 Schlaefer 2022-02-03 16:07:02 UTC
Created attachment 146231 [details]
System Settings most used shows same module twice

Sorry, original example video had annoying desktop background audio.
Comment 2 Nate Graham 2022-02-03 18:10:49 UTC
Can reproduce. Duplicate items aren't filtered out. Hopefully should not be too hard to fix.
Comment 3 Nate Graham 2022-02-15 18:28:46 UTC
Looks like the model data comes from KActivitiesStats; the duplicate data should probably ne filtered out there, not not even added in the first place.
Comment 4 Nate Graham 2022-03-21 03:20:22 UTC
*** Bug 450972 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2022-03-26 13:58:21 UTC
*** Bug 451922 has been marked as a duplicate of this bug. ***
Comment 6 Alfonso Murolo 2022-04-09 18:19:05 UTC
(In reply to Nate Graham from comment #3)
> Looks like the model data comes from KActivitiesStats; the duplicate data
> should probably ne filtered out there, not not even added in the first place.

Hi Nate, I am trying to investigate this behavior. The duplicate data comes indeed from there. However, i believe the issue comes at insertion time. Apparently, when the notification to KActivitiesStats happens, it happens in such a way that the module ID sent is different. When accessing the last 20 characters of such module IDs from the statistics, I manage to get two different results for the same item (plasmasearch):
kf.activitiesstats: Item:  ⊥ 26 "" 1648998245 "_lookandfeel.desktop"
kf.activitiesstats: Item:  ⊥ 14 "" 1648998547 "cm_baloofile.desktop"
kf.activitiesstats: Item:  ⊥ 11.4125 "" 1649527799 "kcm:kcm_plasmasearch"
kf.activitiesstats: Item:  ⊥ 7 "" 1648998547 "plasmasearch.desktop"
kf.activitiesstats: Item:  ⊥ 6 "" 1648998246 "cm:kcm_style.desktop"

Specifically, it seems sometimes the kcm_pasmasearch.desktop item is sent without the .desktop extension, and some others with the extension. However, now that I am trying to purposefully spawn something which notifies it with the extension, I don´t seem to be able to. Any ideas what could be causing it? Maybe some other project is notifying access to this KCM file incorrectly?
Comment 7 Alfonso Murolo 2022-04-10 14:33:52 UTC
(In reply to Schlaefer from comment #0)
> Created attachment 146230 [details]
> System Settings most used shows same module twice
> 
> SUMMARY
> 
> The "Most Used Settings" shows same item twice.
> 
> STEPS TO REPRODUCE
> 
> 1. Open System Settings
> 2. Have my setup and System Settings usage behavior
> 
> OBSERVED RESULT
> 
> "Display Configuration" is shown twice for me.
> 
> See attached video.
> 
> EXPECTED RESULT
> 
> Display Configuration module should only be displayed once.
> 
> SOFTWARE/OS VERSIONS
> Operating System: EndeavourOS
> KDE Plasma Version: 5.24.80
> KDE Frameworks Version: 5.91.0
> Qt Version: 5.15.2
> Kernel Version: 5.16.4-242-tkg-cacule (64-bit)
> Graphics Platform: Wayland
> Processors: 12 × 11th Gen Intel® Core™ i5-11400 @ 2.60GHz
> Memory: 31,2 GiB of RAM
> Graphics Processor: AMD Radeon RX 5500 XT

(In reply to Alfonso Murolo from comment #6)
> (In reply to Nate Graham from comment #3)
> > Looks like the model data comes from KActivitiesStats; the duplicate data
> > should probably ne filtered out there, not not even added in the first place.
> 
> Hi Nate, I am trying to investigate this behavior. The duplicate data comes
> indeed from there. However, i believe the issue comes at insertion time.
> Apparently, when the notification to KActivitiesStats happens, it happens in
> such a way that the module ID sent is different. When accessing the last 20
> characters of such module IDs from the statistics, I manage to get two
> different results for the same item (plasmasearch):
> kf.activitiesstats: Item:  ⊥ 26 "" 1648998245 "_lookandfeel.desktop"
> kf.activitiesstats: Item:  ⊥ 14 "" 1648998547 "cm_baloofile.desktop"
> kf.activitiesstats: Item:  ⊥ 11.4125 "" 1649527799 "kcm:kcm_plasmasearch"
> kf.activitiesstats: Item:  ⊥ 7 "" 1648998547 "plasmasearch.desktop"
> kf.activitiesstats: Item:  ⊥ 6 "" 1648998246 "cm:kcm_style.desktop"
> 
> Specifically, it seems sometimes the kcm_pasmasearch.desktop item is sent
> without the .desktop extension, and some others with the extension. However,
> now that I am trying to purposefully spawn something which notifies it with
> the extension, I don´t seem to be able to. Any ideas what could be causing
> it? Maybe some other project is notifying access to this KCM file
> incorrectly?

I still can´t put my finger on this, but I am under the impression that this phenomenon is the result of the KActivities-stats database being notified differently over different KDE versions. 
@Schlaefer: did you update your KDE version before noticing this bug, by any chance?
Comment 8 Schlaefer 2022-04-10 15:04:02 UTC
> @Schlaefer: did you update your KDE version before noticing this bug, by any chance?

It happened on a live system which is kept up to date and was in regular use for over a year. I never saw duplicates before but immediately after updating to the 5.24 beta for testing. Since then the issue disappeared (multiple, different items are shown). So when it comes to version updates it was during the 5.23 → 5.24 plasma transition.
Comment 9 Nate Graham 2022-04-11 17:28:34 UTC
CCing Ivan who may understand more.
Comment 10 Ivan Čukić 2022-04-11 20:13:20 UTC
Hi Schlaefer,

Can you post the output of the following here (as two attachments).

sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from ResourceScoreCache where initiatingAgent = "org.kde.systemsettings";'

and

sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from ResourceEvent where initiatingAgent = "org.kde.systemsettings";'

I see two possible causes of this -- plasma changed how it reports KCM URLs (but the kcm: prefix wasn't added in 5.24) or, as you said, some other component reporting this the wrong way.

This is not something that KActivities can handle, but we can prune the invalid ones easily when they are loaded in system settings.
Comment 11 Alfonso Murolo 2022-05-01 09:19:54 UTC
(In reply to Ivan Čukić from comment #10)
> Hi Schlaefer,
> 
> Can you post the output of the following here (as two attachments).
> 
> sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from
> ResourceScoreCache where initiatingAgent = "org.kde.systemsettings";'
> 
> and
> 
> sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from
> ResourceEvent where initiatingAgent = "org.kde.systemsettings";'
> 
> I see two possible causes of this -- plasma changed how it reports KCM URLs
> (but the kcm: prefix wasn't added in 5.24) or, as you said, some other
> component reporting this the wrong way.
> 
> This is not something that KActivities can handle, but we can prune the
> invalid ones easily when they are loaded in system settings.

Hi Ivan, 

for what it's worth, I am sending you my output in the VM where I have been replicating it. Currently, I get duplicate output for "File Search" if I open systemsettings.

> 0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:about-distro.desktop|0|3.0|1639847651|1648997945
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_baloofile.desktop|0|14.0|1639847870|1648998547
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_lookandfeel.desktop|0|26.0|1639864711|1648998245
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kwinoptions.desktop|0|0.0|1648996660|1648996660
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:screenlocker.desktop|0|0.0|1648996674|1648996674
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_translations.desktop|0|0.0|1648996682|1648996682
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_notifications.desktop|0|2.0|1648998038|1648998075
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:fontinst.desktop|0|0.0|1648998040|1648998040
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_workspace.desktop|0|0.0|1648998042|1648998042
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_kup.desktop|0|1.0|1648998067|1648998069
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_style.desktop|0|6.0|1648998225|1648998246
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_plasmasearch.desktop|0|7.0|1648998521|1648998547
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_lookandfeel|0|11.5568568269966|1649108250|1649600255
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_plasmasearch|0|20.412484512923|1649176526|1649529146
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_baloofile|0|8.96923323447635|1649177402|1649598590
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_style|0|1.0|1649179696|1649194468
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_updates|0|0.0|1649194308|1649194308
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_desktoptheme|0|0.0|1649194468|1649194468
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_kwindecoration|0|0.0|1649194473|1649194473
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_fonts|0|0.0|1649194473|1649194473
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_icons|0|0.0|1649194475|1649194475
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_translations|0|0.0|1649194599|1649194599
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_kscreen|0|0.0|1649509984|1649509984
> f0963528-319c-4763-a86b-580f3e27e664|org.kde.systemsettings|kcm:kcm_sddm|0|0.0|1649600261|1649600261
Comment 12 Alfonso Murolo 2022-05-01 09:25:18 UTC
(In reply to Ivan Čukić from comment #10)
> Hi Schlaefer,
> 
> Can you post the output of the following here (as two attachments).
> 
> sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from
> ResourceScoreCache where initiatingAgent = "org.kde.systemsettings";'
> 
> and
> 
> sqlite3 ~/.local/share/kactivitymanagerd/resources/database 'select * from
> ResourceEvent where initiatingAgent = "org.kde.systemsettings";'
> 
> I see two possible causes of this -- plasma changed how it reports KCM URLs
> (but the kcm: prefix wasn't added in 5.24) or, as you said, some other
> component reporting this the wrong way.
> 
> This is not something that KActivities can handle, but we can prune the
> invalid ones easily when they are loaded in system settings.

The second command instead produces the following output (I used pastebin since it is very long): https://pastebin.com/QxW41TRB
Comment 13 Schlaefer 2022-05-02 06:47:35 UTC
Created attachment 148508 [details]
sqlite3  ResourceEvent and ResourceScoreCache output

Here the sqlite3 query result.

PS: Sorry for the late answer, it got buried in my inbox.
Comment 14 Alexander Lohnau 2022-07-24 16:06:57 UTC
I can not reproduce the issue in 5.25. Even though I have some "kcm:kcm_baloofile" and "kcm:kcm_baloofile.desktop" file entries in my DB and I manually messed with their score so that they show up.
Comment 15 Nate Graham 2022-07-24 17:11:11 UTC
Created attachment 150880 [details]
Still reproducing

Still reproducing for me; see attachment.

Can I send you my database file?
Comment 16 Alexander Lohnau 2022-07-24 18:51:55 UTC
Please do :)
Comment 17 Nate Graham 2022-07-24 20:44:11 UTC
Sure, where does it live?
Comment 18 Pawel 2022-07-25 08:17:16 UTC
Created attachment 150889 [details]
duplicated module audio

I can reproduce as well - currently the Audio module is duplicated. Screenshot + db query results attached
Comment 19 Pawel 2022-07-25 08:17:57 UTC
Created attachment 150890 [details]
resourceEvent

+resource event
Comment 20 Pawel 2022-07-25 08:18:36 UTC
Created attachment 150891 [details]
ResourceScoreCache

+ ResourceScoreCache
Comment 21 Alexander Lohnau 2022-08-19 09:04:01 UTC
I am unable to reproduce the issue by importing these two tables. The recently used pages are just empty :/

@Nate could you please send me your ~/.local/share/kactivitymanagerd/resources/database file? Maybe just do it using Mail/Telegram to avoid posting this much data publicly.
Comment 22 Nate Graham 2022-08-19 13:47:27 UTC
Done.
Comment 23 Bug Janitor Service 2022-08-19 15:12:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1105
Comment 24 Alexander Lohnau 2022-08-20 11:38:50 UTC
Git commit 9a78c778c24564bf71571c3993deddb20baa104f by Alexander Lohnau.
Committed on 20/08/2022 at 11:35.
Pushed by alex into branch 'master'.

Fix KCM duplicates in landingpage

In systemsettings, we no longer write a ".desktop" at the end of the KCM ids.
This change was made during Plasma 5.24. However, it causes duplicates on some setups.
To avoid this, we ignore all of the old .desktop URLs. To ensure that we fill all of the 6 available
items, the limit is increased to 12 and we check against a list how many results we have ignored.

M  +9    -2    kcms/landingpage/landingpage.cpp
M  +1    -0    kcms/landingpage/landingpage.h

https://invent.kde.org/plasma/plasma-desktop/commit/9a78c778c24564bf71571c3993deddb20baa104f
Comment 25 Alexander Lohnau 2022-08-21 06:16:55 UTC
Git commit 44821ceddc9bd14f72bf1e9e4c5f22119f657262 by Alexander Lohnau.
Committed on 21/08/2022 at 06:16.
Pushed by alex into branch 'Plasma/5.25'.

Fix KCM duplicates in landingpage

In systemsettings, we no longer write a ".desktop" at the end of the KCM ids.
This change was made during Plasma 5.24. However, it causes duplicates on some setups.
To avoid this, we ignore all of the old .desktop URLs. To ensure that we fill all of the 6 available
items, the limit is increased to 12 and we check against a list how many results we have ignored.


(cherry picked from commit 9a78c778c24564bf71571c3993deddb20baa104f)

M  +9    -2    kcms/landingpage/landingpage.cpp
M  +1    -0    kcms/landingpage/landingpage.h

https://invent.kde.org/plasma/plasma-desktop/commit/44821ceddc9bd14f72bf1e9e4c5f22119f657262