Bug 424505 - Possible regression in storing launch counts
Summary: Possible regression in storing launch counts
Status: RESOLVED FIXED
Alias: None
Product: frameworks-krunner
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-21 14:49 UTC by Kai Uwe Broulik
Modified: 2020-10-05 14:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Uwe Broulik 2020-07-21 14:49:29 UTC
SUMMARY
I haven't verified it yet but it appears KRunner launch count stuff isn't persisted properly anymore. Especially now that the recent docs runner results are all over the place, this gets more noticeable, that it doesn't reliably "learn" your preferences anymore.

STEPS TO REPRODUCE
1. Search "spotify"
2. Get pointless recent documents results and Spotify app at the end of the list
3. Launch Spotify app
4. Search "spotify" again
5. Get Spotify at the top of the list because of launch count as expected
6. Now kquitapp5 krunner
7. Search "spotify" again

OBSERVED RESULT
Gets same pointless results as at the beginning

EXPECTED RESULT
Remembered Spotify app launch count thingie and prefer it over the recent docs results, to "learn what the user launches"

Same also happens with Telegram.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.72 git build of 2020-07-08
Qt Version: 5.14.2
Comment 1 Alexander Lohnau 2020-07-21 15:47:47 UTC
I can confirm this issue but it is not a regression. I will do some testing, but already have pretty much identified the issue.

Will write a patch soon :-).
Comment 2 Alexander Lohnau 2020-07-21 18:14:43 UTC
There are actually two issues:
1: The entries don't get properly persisted, this can be fixed by syncing them after each session. Just like the history entries.
2: In milou lib/resultsmodel.cpp line 87+ we prefer the type over the relevance.
If we launch an entry very often the position changes only inside of its group, pretty much the same issue as in BUG 340283.
Comment 3 Alexander Lohnau 2020-08-04 05:13:42 UTC
Git commit 45d42bb9520ff3130753535012ec3939df232a37 by Alexander Lohnau.
Committed on 04/08/2020 at 05:02.
Pushed by alex into branch 'master'.

Save RunnerContext after each match session
If we only save the context in the deconstructor the
entries don't get saved when we kill krunner/shutdown/reboot.
Currently they only get saved when we end krunner using
`kquitapp5 krunner`.

The history items are also synced after each session.

M  +4    -6    src/runnermanager.cpp

https://invent.kde.org/frameworks/krunner/commit/45d42bb9520ff3130753535012ec3939df232a37
Comment 4 Alexander Lohnau 2020-10-05 14:39:24 UTC
Marking this as fixed: A better rating system is mentioned in other bugs and a different system of storing launch counts is already in progress.