Bug 497958 - Removing package with favourites entry leaves ghost favourites entry behind until plasmashell is restarted
Summary: Removing package with favourites entry leaves ghost favourites entry behind ...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) widget (show other bugs)
Version: 6.2.4
Platform: Gentoo Packages Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 498172 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-12-27 20:52 UTC by Karl-Johan Karlsson
Modified: 2025-02-08 03:32 UTC (History)
3 users (show)

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


Attachments
Screenshot showing Kicker offering to remove GnuCash from favourites, even though it's not there (211.91 KB, image/png)
2024-12-27 20:52 UTC, Karl-Johan Karlsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karl-Johan Karlsson 2024-12-27 20:52:56 UTC
Created attachment 176915 [details]
Screenshot showing Kicker offering to remove GnuCash from favourites, even though it's not there

SUMMARY
If I add an application to my favourites in Kicker, remove the OS package containing that application, and then reinstall that OS package, Kicker continues to think that the application is already in my favourites and does not let me add it, even though it isn't shown. I also cannot remove it, because it isn't there.

This happened when there was a bug in GnuCash ( https://bugs.gentoo.org/941426 ) that meant the package couldn't be upgraded in place; instead, I had to first uninstall the old package and then install the new package. Afterwards, I cannot get GnuCash back among my favourites.

I have not found where in the configuration the favourites list is stored to attempt to remove the ghost entry manually.

STEPS TO REPRODUCE
1. Install an OS package containing a .desktop file which results in a launcher menu entry (e.g. GnuCash).
2. In the Kicker menu, browse to the installed application, right-click and select "Add to Favorites"
3. Observe that the application's icon appears in Kicker's favourites bar to the left of the menu tree.
4. Uninstall the OS package.
5. Observe that the application's icon disappears from Kicker's favourites bar.
6. Reinstall the OS package.
7. Observe that the application's icon does not reappear in Kicker's favourites bar.
8. Attempt to repeat step 2: In the Kicker menu, browse to the installed application, and right-click.
9. Observe that the "Add to Favorites" option is not available this time. Instead, the option "Remove from Favorites" is shown.
10. Select "Remove from Favorites".
11. Observe that the session's error log (in my case, for an X11 session started from SDDM, that's ~/.local/share/sddm/xorg-session.log) now shows the error:
   org.kde.plasma.kicker: Entry is not valid "gnucash.desktop" 0x55a3e2bc8b90
12. Observe that the favourites bar does not change.
13. Repeat step 8: In the Kicker menu, browse to the installed application, and right-click.
14. Observe that the menu still only offers to "Remove from Favorites".

EXPECTED RESULT
A removed .desktop file would be removed from the favourites list, so it can be re-added later.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux 2.17
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Kernel Version: 6.12.4-gentoo-r1-x86_64 (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 7 PRO 3700U w/ Radeon Vega Mobile Gfx
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Vega 10 Graphics
Comment 1 Nate Graham 2025-01-03 21:32:45 UTC
Can reproduce. Maybe related to Bug  498172.
Comment 2 Karl-Johan Karlsson 2025-01-03 21:55:20 UTC
It turns out that a reboot cleared the "ghost" entry, so I can now re-add the application to my favourites.
Comment 3 Bug Janitor Service 2025-01-09 13:58:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5047
Comment 4 Harald Sitter 2025-01-10 11:33:12 UTC
*** Bug 498172 has been marked as a duplicate of this bug. ***
Comment 5 Fushan Wen 2025-02-02 10:07:58 UTC
Git commit 777f24cadb6dd16ad68b7a147090197c70e2bda1 by Fushan Wen, on behalf of Harald Sitter.
Committed on 02/02/2025 at 10:06.
Pushed by fusionfuture into branch 'master'.

kicker: remove favorites more reliably

previously we'd trip up on removal because the value of m_itemEntries
may no longer point to an existing resource. when that is the case we
must go by the key inside the map to relibably remove the favorite.

M  +3    -1    applets/kicker/plugin/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/777f24cadb6dd16ad68b7a147090197c70e2bda1
Comment 6 Fushan Wen 2025-02-02 13:01:57 UTC
Git commit 2be342d610ca22e397801f3bc81cf3fc279c5dff by Fushan Wen.
Committed on 02/02/2025 at 10:08.
Pushed by fusionfuture into branch 'Plasma/6.3'.

kicker: remove favorites more reliably

previously we'd trip up on removal because the value of m_itemEntries
may no longer point to an existing resource. when that is the case we
must go by the key inside the map to relibably remove the favorite.


(cherry picked from commit 777f24cadb6dd16ad68b7a147090197c70e2bda1)

Co-authored-by: Harald Sitter <sitter@kde.org>

M  +3    -1    applets/kicker/plugin/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/2be342d610ca22e397801f3bc81cf3fc279c5dff