Bug 474223 - Changes to pinned apps are only saved at quit, so changes can be lost if there's a power outage or plasmashell crashes
Summary: Changes to pinned apps are only saved at quit, so changes can be lost if ther...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (other bugs)
Version First Reported In: master
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6, wayland-only
Depends on:
Blocks:
 
Reported: 2023-09-06 13:35 UTC by Paolo Zamponi
Modified: 2023-10-24 18:30 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Zamponi 2023-09-06 13:35:58 UTC
SUMMARY
***

STEPS TO REPRODUCE
1. Make sure you're running a Wayland session;
2. Pin one or more apps on the system bar;
3. Reboot / Shutdown / Log off.

OBSERVED RESULT
Pinned apps are no longer on the bar.

EXPECTED RESULT
Pinned apps remain on the bar.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Kernel Version: 5.15.0-83-generic (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
It's Wayland specific.
Comment 1 Firlaev-Hans 2023-09-06 16:33:30 UTC
Looks like while changes like adding and removing widgets are immediately written to .config/plasma-org.kde.plasma.desktop-appletsrc, changes to the pinned launchers in the task manager are now only written when plasmashell exits, and does so "gracefully"? 
When I run plasmashell --replace, the changes are saved and kept, but if I not-so-gently kill either plasmashell or KWin, the changes are not saved.
When shutting down / logging out, plasmashell behaves as if KWin died, according to the journal (this is the case on 5.27 too):
plasmashell[3262]: The Wayland connection broke. Did the Wayland compositor die?
Comment 2 Nate Graham 2023-09-06 17:16:03 UTC
Good investigation. That seems likely, as my Plasmashell has started to crash on quit too and I can reproduce the bug. That will be fixed with https://invent.kde.org/plasma/kwayland-integration/-/merge_requests/48 though, which should be sufficient to fix this specific issue.

However let's broaden the topic of this bug report a bit to request that configs get saved before quit so we canharden Plasmashell a bit against crashes, power loss, etc.
Comment 3 Firlaev-Hans 2023-09-06 17:35:54 UTC
> However let's broaden the topic of this bug report a bit to request that configs get saved
> before quit so we can harden Plasmashell a bit against crashes, power loss, etc.

That's how it already worked in Plasma 5 (on 5.27.7 at least); any changes would be written to disk immediately.
It was apparently changed in Plasma 6, either intentionally or not, but curiously *only for pinned task manager items and nothing else* as far as I can tell, which seems quite odd.
Comment 4 Nate Graham 2023-09-06 18:51:20 UTC
Interesting. I'm not aware of any intentional work there, so perhaps it was an oversight or an unintentional regression.
Comment 5 Paolo Zamponi 2023-10-24 09:01:52 UTC
It seems it works now...
Comment 6 Nate Graham 2023-10-24 18:29:20 UTC
Nah, can still reproduce if I re-arrange pinned apps and then do `kill -9 plasmashell` in a terminal window.
Comment 7 Nate Graham 2023-10-24 18:30:10 UTC
Although if I kill without -9, it does work. `kill -9` is more severe than a crash, so maybe you're right!