Bug 415874

Summary: When session restoration is in use, Discover always gets launched after rebooting
Product: [Applications] Discover Reporter: Nate Graham <nate>
Component: discoverAssignee: Dan Leinir Turthra Jensen <leinir>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, csukask, kernozz, sergio.callegari, top.lamp4866
Priority: HI    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=419968
https://bugs.kde.org/show_bug.cgi?id=420901
Latest Commit: Version Fixed In: 5.20.3
Sentry Crash Report:

Description Nate Graham 2020-01-04 16:05:33 UTC
Perhaps the notifier gets mistaken for the app itself? Either way, when using session restoration, every time I reboot, Discover is launched. This has reproduced for me on Manjaro and openSUSE Tumbleweed.
Comment 1 Nate Graham 2020-04-15 00:13:15 UTC
*** Bug 419257 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2020-04-22 04:25:31 UTC
*** Bug 420393 has been marked as a duplicate of this bug. ***
Comment 3 Aleix Pol 2020-05-22 17:23:29 UTC
Could you try running plasma-autostart-list? It's a test application built by plasma-workspace.

It could help us see where plasma gets the idea of starting discover.

I get something like this:
$ ./bin/plasma-autostart-list
phase: 0
- xembedsniproxy /home/apol/devel/kde5/etc/xdg/autostart/xembedsniproxy.desktop
- org.kde.plasmashell /home/apol/devel/kde5/etc/xdg/autostart/org.kde.plasmashell.desktop
- polkit-kde-authentication-agent-1 /home/apol/devel/kde5/etc/xdg/autostart/polkit-kde-authentication-agent-1.desktop
- kaccess /home/apol/devel/kde5/etc/xdg/autostart/kaccess.desktop

phase: 1
- gmenudbusmenuproxy /home/apol/devel/kde5/etc/xdg/autostart/gmenudbusmenuproxy.desktop
- org.kde.discover.notifier /home/apol/devel/kde5/etc/xdg/autostart/org.kde.discover.notifier.desktop
- org.kde.kdeconnect.daemon /home/apol/devel/kde5/etc/xdg/autostart/org.kde.kdeconnect.daemon.desktop
- pulseaudio /etc/xdg/autostart/pulseaudio.desktop

phase: 2
- org.kde.yakuake /home/apol/.config/autostart/org.kde.yakuake.desktop
- tracker-store /etc/xdg/autostart/tracker-store.desktop, startAfter:panel
- snap-userd-autostart /etc/xdg/autostart/snap-userd-autostart.desktop
- powerdevil /home/apol/devel/kde5/etc/xdg/autostart/powerdevil.desktop
- gnome-shell-overrides-migration /etc/xdg/autostart/gnome-shell-overrides-migration.desktop
- geoclue-demo-agent /etc/xdg/autostart/geoclue-demo-agent.desktop
Comment 4 Nate Graham 2020-05-22 17:28:46 UTC
Here's what I have:


phase: 0
- pam_kwallet_init /etc/xdg/autostart/pam_kwallet_init.desktop
- org.kde.plasmashell /home/nate/kde/usr/etc/xdg/autostart/org.kde.plasmashell.desktop
- kaccess /home/nate/kde/usr/etc/xdg/autostart/kaccess.desktop
- polkit-kde-authentication-agent-1 /home/nate/kde/usr/etc/xdg/autostart/polkit-kde-authentication-agent-1.desktop
- xembedsniproxy /home/nate/kde/usr/etc/xdg/autostart/xembedsniproxy.desktop
- baloo_file /home/nate/kde/usr/etc/xdg/autostart/baloo_file.desktop

phase: 1
- xdg-user-dirs /etc/xdg/autostart/xdg-user-dirs.desktop
- pulseaudio /etc/xdg/autostart/pulseaudio.desktop
- gmenudbusmenuproxy /home/nate/kde/usr/etc/xdg/autostart/gmenudbusmenuproxy.desktop
- org.kde.kdeconnect.daemon /home/nate/kde/usr/etc/xdg/autostart/org.kde.kdeconnect.daemon.desktop
- org.kde.discover.notifier /home/nate/kde/usr/etc/xdg/autostart/org.kde.discover.notifier.desktop

phase: 2
- hplip-systray /etc/xdg/autostart/hplip-systray.desktop
- xbindkeys /home/nate/.config/autostart/xbindkeys.desktop
- z-displaycal-apply-profiles /home/nate/.config/autostart/z-displaycal-apply-profiles.desktop
- powerdevil /home/nate/kde/usr/etc/xdg/autostart/powerdevil.desktop
- kup-daemon /home/nate/kde/usr/etc/xdg/autostart/kup-daemon.desktop, startAfter:panel
- SpiderOakONE /home/nate/.config/autostart/SpiderOakONE.desktop
- ibus-autostart /etc/xdg/autostart/ibus-autostart.desktop, startAfter:panel
- telegramdesktop /home/nate/.config/autostart/telegramdesktop.desktop



I guess the notifier causes all of Discover to get launched?
Comment 5 Aleix Pol 2020-05-22 18:06:48 UTC
Git commit 0012f339a6cb5fbfd51ad1747373a081a88959c2 by Aleix Pol.
Committed on 22/05/2020 at 18:06.
Pushed by apol into branch 'Plasma/5.18'.

Disable session management for Discover

M  +1    -0    discover/main.cpp

https://invent.kde.org/plasma/discover/commit/0012f339a6cb5fbfd51ad1747373a081a88959c2
Comment 6 Patrick Silva 2020-10-22 10:17:04 UTC
*** Bug 428072 has been marked as a duplicate of this bug. ***
Comment 7 Nate Graham 2020-10-25 16:23:19 UTC
Clearly not fixed. :( Can reproduce myself.
Comment 8 Nate Graham 2020-10-29 20:43:10 UTC
Git commit 718e6fdc1019f2a3153b1c45f79b90ec598a826d by Nate Graham.
Committed on 29/10/2020 at 20:42.
Pushed by ngraham into branch 'master'.

Disable session management properly

The attribute needs to be set before the QGuiApplication is created or
else it doesn't have any effect.

M  +3    -1    discover/main.cpp

https://invent.kde.org/plasma/discover/commit/718e6fdc1019f2a3153b1c45f79b90ec598a826d
Comment 9 Nate Graham 2020-10-29 20:43:48 UTC
Git commit d513a424dc7f35246e712359e0807d01431da579 by Nate Graham.
Committed on 29/10/2020 at 20:43.
Pushed by ngraham into branch 'Plasma/5.20'.

Disable session management properly

The attribute needs to be set before the QGuiApplication is created or
else it doesn't have any effect.
(cherry picked from commit 718e6fdc1019f2a3153b1c45f79b90ec598a826d)

M  +3    -1    discover/main.cpp

https://invent.kde.org/plasma/discover/commit/d513a424dc7f35246e712359e0807d01431da579
Comment 10 top.lamp4866 2021-01-20 18:52:09 UTC
I have seen this behavior several times on Kubuntu 20.10 (plasma-discover 5.19.5)

When this happens, it is always after DiscoverNotifier has notified about updates, I have used it to launch discover, installed updates, and closed discover when it has completed during the previous KDE session. I notice that most of the time after closing it, there is a "stuck" "plasma-discover --mode update" process hanging around.

So I think the root cause is not some bug with the session management/restoration functionality, but with a hang in plasma-discover at close (the window is gone so the user thinks it has exited, but the process remains and is still registered with the session).

I will try to catch a stacktrace next time I see it.
Comment 11 Nate Graham 2021-01-20 18:58:34 UTC
No need, it was already fixed in Plasma 5.20.3. :)
Comment 12 top.lamp4866 2021-01-20 19:03:05 UTC
I understand that the fix was to disable session support in discover though, am I mistaken? 

If session restoration is enabled, and discover was open when the session was exited, it should be restored next time..
Comment 13 top.lamp4866 2021-01-21 19:45:09 UTC
I was able to catch the issue (in my case) that leads to discover being restored on login again, please see Bug 431892. Perhaps it is the root cause for others.
Comment 14 Nate Graham 2021-04-13 17:37:30 UTC
*** Bug 435683 has been marked as a duplicate of this bug. ***