guard against plasmashell being properly dead and not showing the SNI
ClosedPublic

Authored by sitter on Jul 19 2019, 10:41 AM.

Details

Summary

when plasmashell is particularly dead and not even able to restart, the SNI
host may still be around when we check for it in the main.cpp as its
disappearance from dbus is tied to sockets closing and dbus' event loop
reacting to that. so there is a race potential that can cause the SNI
to not actually be visible on account of the SNI host (plasmashell)
being dead even though we expected SNI support to be available.

guard against this scenario by starting an automatic activation timer
when the notification service disappears. should it not reappear within
10 second we consider it dead and show the dialog automatically as the
user won't be seeing the SNI anymore

Test Plan
  • crash something so the sni appears
  • kill plasma
  • wait 10s
  • dialog appears
  • same again
  • restart plasma before 10s have passed
  • sni appears again in plasmashell

Diff Detail

Repository
R871 DrKonqi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Jul 19 2019, 10:41 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 19 2019, 10:41 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sitter requested review of this revision.Jul 19 2019, 10:41 AM

Concept is fine, but you probably want to watch whether the SNI Watcher has an available host.

src/statusnotifier.cpp
100

SNIs are different to notifications.

I suspect we'll also want bool StatusNotifier::notificationServiceRegistered further down changed?

This actually sucks tremendously.

Kai said he used that service because he primarily cared about the notification being pretty.

BUUUT actually considering the StatusNotifierHost is hugely horrible. We'd have to check and watch StatusNotifierWatcher (kded) which tracks the hosts (plasmashell) and then watch its host registration property. This would blow things up quite a bit and honestly it's not wroth the faff as we could just latch on to the Notifications service and get much the same end result in 99% of cases I imagine?

davidedmundson accepted this revision.Jul 23 2019, 6:46 AM
This revision is now accepted and ready to land.Jul 23 2019, 6:46 AM
This revision was automatically updated to reflect the committed changes.