After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710596 - Fix fallout from notification changes
Fix fallout from notification changes
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-21 23:32 UTC by Florian Müllner
Modified: 2013-10-30 15:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Move helper function (1.43 KB, patch)
2013-10-21 23:32 UTC, Florian Müllner
reviewed Details | Review
Fix fallout from notification changes (1.66 KB, patch)
2013-10-22 00:05 UTC, Florian Müllner
committed Details | Review
notificationDaemon: Pass the correct id to makeButton() (1.15 KB, patch)
2013-10-22 00:05 UTC, Florian Müllner
committed Details | Review
NotificationDaemon: fix more fallout (840 bytes, patch)
2013-10-22 22:21 UTC, Giovanni Campagna
committed Details | Review
notificationDaemon: Unpack button label (1.03 KB, patch)
2013-10-26 02:53 UTC, Florian Müllner
committed Details | Review
notificationDaemon: Fix button parameter name (958 bytes, patch)
2013-10-26 02:53 UTC, Florian Müllner
committed Details | Review
notificationDaemon: Fix urgency hint (1.21 KB, patch)
2013-10-27 10:23 UTC, Florian Müllner
committed Details | Review
notificationDaemon: Fix custom icons (1.14 KB, patch)
2013-10-27 10:35 UTC, Florian Müllner
committed Details | Review
notificationDaemon: Save notifications on source destruction (1.54 KB, patch)
2013-10-28 11:21 UTC, Florian Müllner
committed Details | Review
messageTray: Emit Source::count-updated before destruction (1.04 KB, patch)
2013-10-28 11:22 UTC, Florian Müllner
none Details | Review

Description Florian Müllner 2013-10-21 23:32:48 UTC
See patch.
Comment 1 Florian Müllner 2013-10-21 23:32:51 UTC
Created attachment 257801 [details] [review]
Move helper function

Commit 5f081b8f8d5c4 moved the code which uses it to notifictionDaemon,
but forgot to move the function as well.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-10-21 23:52:01 UTC
Review of attachment 257801 [details] [review]:

We can simply replace this with str.endsWith().
Comment 3 Florian Müllner 2013-10-22 00:05:24 UTC
Created attachment 257802 [details] [review]
Fix fallout from notification changes
Comment 4 Florian Müllner 2013-10-22 00:05:30 UTC
Created attachment 257803 [details] [review]
notificationDaemon: Pass the correct id to makeButton()

The function expects the action's ID, not the notification's one.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-10-22 00:13:33 UTC
Review of attachment 257802 [details] [review]:

OK.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-10-22 00:13:39 UTC
Review of attachment 257803 [details] [review]:

Yes.
Comment 7 Giovanni Campagna 2013-10-22 22:21:14 UTC
Created attachment 257884 [details] [review]
NotificationDaemon: fix more fallout

Missing Gtk import for action-icon buttons.
Comment 8 Florian Müllner 2013-10-22 22:22:34 UTC
Review of attachment 257884 [details] [review]:

Yup.
Comment 9 Florian Müllner 2013-10-26 02:53:49 UTC
Created attachment 258152 [details] [review]
notificationDaemon: Unpack button label

deep_unpack() doesn't unpack as deeply as one might hope ...
Comment 10 Florian Müllner 2013-10-26 02:53:58 UTC
Created attachment 258153 [details] [review]
notificationDaemon: Fix button parameter name

Gio ended up using 'target' rather than 'action-target'.
Comment 11 Florian Müllner 2013-10-26 02:56:37 UTC
Attachment 257802 [details] pushed as 4b09d57 - Fix fallout from notification changes
Attachment 257803 [details] pushed as 61c5b8e - notificationDaemon: Pass the correct id to makeButton()
Comment 12 Giovanni Campagna 2013-10-26 12:54:13 UTC
Review of attachment 258152 [details] [review]:

What type is buttons? a{sv}?
Should we have a comment for documentation purposes?
Comment 13 Giovanni Campagna 2013-10-26 12:55:06 UTC
Review of attachment 258153 [details] [review]:

::: js/ui/notificationDaemon.js
@@ +760,2 @@
     _onButtonClicked: function(button) {
+        let { "action": action, "target": actionTarget } = button;

Single quotes for non translatable strings?
Comment 14 Giovanni Campagna 2013-10-26 12:57:27 UTC
Comment on attachment 257884 [details] [review]
NotificationDaemon: fix more fallout

Attachment 257884 [details] pushed as eb66407 - NotificationDaemon: fix more fallout
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-10-26 15:38:51 UTC
Review of attachment 258152 [details] [review]:

buttons is an a{sv} yes. It's somewhat documented here: https://wiki.gnome.org/GNotification
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-10-26 15:40:30 UTC
Review of attachment 258153 [details] [review]:

We need to fix https://wiki.gnome.org/GNotification then...
Comment 17 Florian Müllner 2013-10-27 10:23:58 UTC
Created attachment 258206 [details] [review]
notificationDaemon: Fix urgency hint

We currently mark notifications as urgent which merely contain the
'urgent' property, even when set to false. Look at the actual value
instead.
Comment 18 Florian Müllner 2013-10-27 10:35:07 UTC
Created attachment 258207 [details] [review]
notificationDaemon: Fix custom icons

The 'icon' property contains a serialized GIcon, so we need to
deserialize it when setting the icon.
Comment 19 Florian Müllner 2013-10-27 10:43:53 UTC
Attachment 258152 [details] pushed as dac513e - notificationDaemon: Unpack button label
Attachment 258153 [details] pushed as 34e75fc - notificationDaemon: Fix button parameter name
Comment 20 Jasper St. Pierre (not reading bugmail) 2013-10-27 14:36:05 UTC
Review of attachment 258206 [details] [review]:

Yep.
Comment 21 Jasper St. Pierre (not reading bugmail) 2013-10-27 14:36:17 UTC
Review of attachment 258207 [details] [review]:

Yep.
Comment 22 Florian Müllner 2013-10-28 11:21:51 UTC
Created attachment 258288 [details] [review]
notificationDaemon: Save notifications on source destruction

While the existing comment is correct in that a source's notifications
will be destroyed first, the code takes a shortcut which prevents the
Source::count-updated signal from being emitted. Given that the purpose
of the signal is to keep notification counters up-to-date which is
pointless when the source is about to be destroyed, the shortcut makes
sense; just save notifications explicitly in that case.
Comment 23 Florian Müllner 2013-10-28 11:22:17 UTC
Created attachment 258289 [details] [review]
messageTray: Emit Source::count-updated before destruction

It isn't useful to emit the 'count-updated' signal for every single
notification when a source is destroyed, so the code takes a shortcut
to prevent this. However the new persistence code in notificationDaemon
now relies on the signal to be emitted once all notifications have
been destroyed, so do this.
Comment 24 Florian Müllner 2013-10-28 11:25:47 UTC
Only one of attachment 258288 [details] [review] and attachment 258289 [details] [review] is needed - I'd go with the former, but no strong preference.
Comment 25 Florian Müllner 2013-10-28 11:29:09 UTC
Attachment 258206 [details] pushed as 04d28a0 - notificationDaemon: Fix urgency hint
Attachment 258207 [details] pushed as 41315f4 - notificationDaemon: Fix custom icons
Comment 26 Jasper St. Pierre (not reading bugmail) 2013-10-28 13:13:42 UTC
I don't understand.

https://git.gnome.org/browse/gnome-shell/tree/js/ui/messageTray.js#n1368

This calls countUpdated when a notification is destroyed, and when the source is destroyed:

https://git.gnome.org/browse/gnome-shell/tree/js/ui/messageTray.js#n1407

We destroy all notifications. Where is this shortcut?
Comment 27 Jasper St. Pierre (not reading bugmail) 2013-10-28 13:14:28 UTC
Review of attachment 258288 [details] [review]:

oh, grr, nevermind, I just noticed it. Yeah, let's do this.
Comment 28 Florian Müllner 2013-10-30 15:41:01 UTC
Attachment 258288 [details] pushed as 633dd0d - notificationDaemon: Save notifications on source destruction