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 775799 - Notification times get reset when I reboot
Notification times get reset when I reboot
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2016-12-08 11:52 UTC by Allan Day
Modified: 2017-02-27 19:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (59.64 KB, image/png)
2016-12-08 11:52 UTC, Allan Day
  Details
messageTray: Add optional datetime parameter to notifications (3.30 KB, patch)
2017-02-27 15:45 UTC, Florian Müllner
committed Details | Review
notificationDaemon: Include timestamp in serialized notifications (2.14 KB, patch)
2017-02-27 15:45 UTC, Florian Müllner
committed Details | Review
telepathyClient: Update notification time from message (1.31 KB, patch)
2017-02-27 15:46 UTC, Florian Müllner
committed Details | Review

Description Allan Day 2016-12-08 11:52:54 UTC
Created attachment 341604 [details]
screenshot

I have a list of old notifications in the calendar drop-down. All the ones that are from a previous boot have the same time - I think the time when I last rebooted.
Comment 1 Florian Müllner 2016-12-08 14:00:03 UTC
Yes, the time shown is the time when the message was added to the list, not when the notification was first received. It shouldn't be hard to change that, the format that is used to serialize notifications is luckily flexible enough to add additional properties ...
Comment 2 Florian Müllner 2017-02-27 15:45:51 UTC
Created attachment 346833 [details] [review]
messageTray: Add optional datetime parameter to notifications

Since the last notification redesign, we've been showing the time a
notification was received in the calendar drop-down. However as the
time is in fact added by the NotificationSection, it is actually the
time a notification was added to the list. Usually that difference is
not significant, except when previously received notifications are
restored on startup.
In order to be able to address those cases, we need a time that is
associated with the notification itself, so add a datetime property
that defaults to the current time, but may be set from an optional
parameter as well.
Comment 3 Florian Müllner 2017-02-27 15:45:59 UTC
Created attachment 346834 [details] [review]
notificationDaemon: Include timestamp in serialized notifications

GNotifications are persistent until dismissed or withdrawn, including
across restarts. As we show the time a notification was received in the
calendar, we need to include that information when serializing the
notification in order to be correct.
Comment 4 Florian Müllner 2017-02-27 15:46:08 UTC
Created attachment 346835 [details] [review]
telepathyClient: Update notification time from message

As the telepathy integration picks up existing channels on startup,
ChatNotifications are another case where the real time the message
was received may be before the time it is picked up by the shell.
While this is less of an annoyance than restored GNotifications, as
it generally only affects restarts from the run dialog, it's an
easy fix now ...
Comment 5 Rui Matos 2017-02-27 17:47:27 UTC
Review of attachment 346833 [details] [review]:

lgtm
Comment 6 Rui Matos 2017-02-27 17:58:18 UTC
Review of attachment 346834 [details] [review]:

ok
Comment 7 Rui Matos 2017-02-27 18:06:26 UTC
Review of attachment 346835 [details] [review]:

++
Comment 8 Florian Müllner 2017-02-27 19:04:58 UTC
Attachment 346833 [details] pushed as 0569bb1 - messageTray: Add optional datetime parameter to notifications
Attachment 346834 [details] pushed as 4e491b6 - notificationDaemon: Include timestamp in serialized notifications
Attachment 346835 [details] pushed as c6f2282 - telepathyClient: Update notification time from message