Bug 510177

Summary: Restored session does not restore any previously opened apps after upgrade to 6.5 beta from openSUSE 15.6 OBS.
Product: [Plasma] plasmashell Reporter: Vadym Krevs <vkrevs>
Component: Session ManagementAssignee: Plasma Bugs List <plasma-bugs-null>
Status: VERIFIED FIXED    
Severity: normal CC: kde, kde, kdedev, natalie_clarius, nate, notmart
Priority: VHI Keywords: regression
Version First Reported In: 6.4.90   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.5.0
Sentry Crash Report:

Description Vadym Krevs 2025-10-02 17:33:39 UTC
SUMMARY
Restored session does not restore any previously opened apps after upgrade to 6.5 beta from openSUSE 15.6 OBS.

STEPS TO REPRODUCE
1.  Login into KDE. Start Konsole, System Monitor and Brave and open a few tabs in each. Rename some tabs in Konsole.
2. Ensure that System Settings->Desktop Session->Session Restore is configured to launch apps that were open on last logout.
2. Log out
3. Log on again

OBSERVED RESULT
Only Brave is restarted. No Konsole tabs with renamed tab titles, no System Monitor, etc

EXPECTED RESULT
Previously running apps  are restarted after log off/log on. Konsole is restarted with the same renamed tabs as on log off.



SOFTWARE/OS VERSIONS
Operating System: openSUSE Leap 15.6
KDE Plasma Version: 6.2.90
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Graphics Platform: X11
Graphics Processor: NVIDIA GeForce RTX 4060 Ti
Comment 1 Vadym Krevs 2025-10-02 17:34:37 UTC
This is a clone of https://bugs.kde.org/show_bug.cgi?id=498782. Created as requested in https://bugs.kde.org/show_bug.cgi?id=498782#c4
Comment 2 Vadym Krevs 2025-10-02 17:35:32 UTC
Apologies, forgot to update SOFTWARE/OS VERSIONS .

Operating System: openSUSE Leap 15.6
KDE Plasma Version: 6.4.90
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.4.0-150600.23.70-default (64-bit)
Graphics Platform: X11
Graphics Processor: NVIDIA GeForce RTX 4060 Ti
Comment 3 TraceyC 2025-10-02 18:56:23 UTC
I can reproduce this on git-master. I had these opened:

Konsole with tabs
Firefox with tabs
Vivaldi with tabs
System Monitor
Dolphin with tabs

After logging back in, none of these were started
Comment 4 Marco Martin 2025-10-03 07:53:49 UTC
do new sessions get saved now? ie was it lost only the session that was there prior the upgrade, or doesn't save at all sessions even now?
Comment 5 Vadym Krevs 2025-10-03 11:43:23 UTC
Nope, new sessions aren't saved either.
Comment 6 Nate Graham 2025-10-03 16:29:31 UTC
hmm, session restore appear to be working as expected for me on current git master.
Comment 7 Vadym Krevs 2025-10-03 16:54:15 UTC
If it helps, when I installed beta 2 of plasma 6.3 (https://bugs.kde.org/show_bug.cgi?id=498782#c2) my old, pre-6.3 beta1, session just magically got restored.  Might be worth checking what changed between 6.3 beta 1 and 2 in session management code.
Comment 8 David Redondo 2025-10-06 13:21:56 UTC
Does ~/.local/state/plasmasessionrestorestaterc look reasonable to you? 

What happens if you run  libexec/plasma-fallback-session-save ?
Comment 9 Vadym Krevs 2025-10-06 19:40:05 UTC
# the contents of the file with Brave, Kate, konsole and system monitor running.
$ cat  ~/.local/state/plasmasessionrestorestaterc 
[0]
appId=brave-browser.desktop


#  Now I run plasma-fallback-session-save
$ /usr/lib/plasma-fallback-session-save

# New file contents:
$ cat /home/vadymk/.local/state/plasmasessionrestorestaterc
[0]
appId=brave-browser.desktop

[1]
appId=org.kde.kate.desktop

[2]
appId=org.kde.konsole.desktop

[3]
appId=org.kde.plasma-systemmonitor.desktop

# Log off/log back in - only Brave is restarted.  File contents after logging back in:
$ cat /home/vadymk/.local/state/plasmasessionrestorestaterc
[0]
appId=brave-browser.desktop
Comment 10 Bug Janitor Service 2025-10-07 09:34:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5896
Comment 11 David Redondo 2025-10-07 10:26:17 UTC
Git commit 669edd5a7d8a44a530ea4bdb26d98612a8f0adef by David Redondo.
Committed on 07/10/2025 at 09:46.
Pushed by davidedmundson into branch 'master'.

ksmserver: Fix saving clients

The condition of the form without subsessions was effectively
if (false || a)
and after dropping subsessions should have been dropped instead of
if (a)
Amends 16e0f29123d00fe76c9002809360bfc6f16300f4

M  +0    -3    ksmserver/server.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/669edd5a7d8a44a530ea4bdb26d98612a8f0adef
Comment 12 Nate Graham 2025-10-07 22:45:07 UTC
Git commit ccd51e44ad80c847f4e9197000846d7d48da1aed by Nate Graham, on behalf of David Edmundson.
Committed on 07/10/2025 at 22:23.
Pushed by ngraham into branch 'Plasma/6.5'.

ksmserver: Fix saving clients

The condition of the form without subsessions was effectively
if (false || a)
and after dropping subsessions should have been dropped instead of
if (a)
Amends 16e0f29123d00fe76c9002809360bfc6f16300f4


(cherry picked from commit 669edd5a7d8a44a530ea4bdb26d98612a8f0adef)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +0    -3    ksmserver/server.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/ccd51e44ad80c847f4e9197000846d7d48da1aed
Comment 13 Vadym Krevs 2025-10-22 17:00:34 UTC
Updated to Plasma 6.5 rpms from opensuse build service and can confirm that sessions are being restored correctly. Thank you for fixing this!
Comment 14 TraceyC 2025-10-22 17:29:25 UTC
That's great to hear, thanks for letting us know.