Make "Updates Available" notification persistent but low priority
ClosedPublic

Authored by ngraham on Jul 12 2019, 10:12 PM.

Details

Summary

Discover's "Updates are available" notification currently suffers from some problems:

  1. With the default timeout, it disappears quickly and is likely to be missed
  2. After timing out, it appears in thie history, where is is both redundant (because the Update Notifier system tray icon has become visible) and also useless (because it can't be interacted with due to https://bugs.kde.org/show_bug.cgi?id=407361 and https://bugs.kde.org/show_bug.cgi?id=407667)
  3. Once updates are performed, the notification in the history sticks around uselessly because notifications can't be revoked once they're in the history (See https://bugs.kde.org/show_bug.cgi?id=409323#c3)

This patch fixes those issues by making the update persistent but low priority.

This means it must be noticed by the user and interacted with in some way before it
disappears from the screen--either by dismissing it or running the updates. But once
dismissed, it's gone forever, and doesn't clutter up your history.

BUG: 409757
BUG: 409331
FIXED-IN: 5.17.0

Test Plan
  1. Have updates available
  2. Deploy patch
  3. Restart plasmashell
  4. See that the notification is now persistent
  5. Dismiss notification
  6. See that it no longer clogs up the history
  7. Restart plasmashell again
  8. Click on the notification's body or "Update" button
  9. See that Discover opens and the notification disappears

Diff Detail

Repository
R134 Discover Software Store
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Jul 12 2019, 10:12 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 12 2019, 10:12 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Jul 12 2019, 10:12 PM
apol accepted this revision.Jul 13 2019, 12:48 AM
This revision is now accepted and ready to land.Jul 13 2019, 12:48 AM
ngraham retitled this revision from Make "Updates Available" nofication persistent but low priority to Make "Updates Available" notification persistent but low priority.Jul 13 2019, 2:31 AM
This revision was automatically updated to reflect the committed changes.
broulik added a subscriber: broulik.EditedJul 15 2019, 7:12 AM

Oh God, please not make it persistent. This notification comes up every single time I start plasmashell and now I have to explicitly manually get rid of it.
Also I disagree security updates available notification should be "low urgency". Instead of making everything that shouldn't be in the history low priority (which is not what low priority means, it is just a side-effect) I would suggest you add a flag for KNotification to not keep in history.

Oh God, please not make it persistent. This notification comes up every single time I start plasmashell and now I have to explicitly manually get rid of it.

That's kind of the point though. The user should be seeing these notifications and having to explicitly acknowledge them in some way; updates are important. If it's annoying for you, maybe you should turn Discover's notifications off entirely?

Or maybe persistent/close on timeout behavior should be user-configurable. It actually is on macOS where each individual notification can be made persistent, close-on-timeout, or disabled.

Also I disagree security updates available notification should be "low urgency". Instead of making everything that shouldn't be in the history low priority (which is not what low priority means, it is just a side-effect) I would suggest you add a flag for KNotification to not keep in history.

Fair point. I'll give it a go.

That's kind of the point though. The user should be seeing these notifications and having to explicitly acknowledge them in some way;

It wasn't nearly as annoying if a kded module was responsible for it and not the applet, so it wouldn't show up every single time I restart plasmashell which I tend to do a lot.

notifier/DiscoverNotifier.cpp
77

Coding style, put contents on a new line

notifier/DiscoverNotifier.h
87

This has to be a QPointer<KNotification>.

KNotification self-deletes when closed leading to crashes in close() calls below accessing garbage memory.

That's kind of the point though. The user should be seeing these notifications and having to explicitly acknowledge them in some way;

It wasn't nearly as annoying if a kded module was responsible for it and not the applet, so it wouldn't show up every single time I restart plasmashell which I tend to do a lot.

Me too. However, this is a developer workflow, not a typical user workflow. Defaults should be optimized for users, not developers. Weirdos like us who are killing and restarting plasmashell 30 times a day can just turn off Discover's updates notification.

I agree that it would be nice if we could somehow make the notification only appear when plasmashell is started due to a login, not every time.

Will fix the code issues you bring up in another patch.

How about only making security update notifications persistent? There is no real harm in missing non-security updates in my opinion.