MinervaNeue/includes/skins
petarpetkovic 413fcc12f6 Fix seen notifications appearing as unseen on mobile
Important note: Make sure to distinguish unseen from unread

One way to reproduce minerva and non-minerva notification inconsistencies:
- Have all your alerts and notices seen. This is displayed with grayed out
number on vector skin or no number at all, if you have (marked as) read.
- Generate new alert or notice (one is enough) in your preferred way.
- You can check minerva and non-minerva at this step. Both should be in sync.
But don't perform any additional action.
- Open the notification popup in some non-minerva skin (I have tried with
vector and monobook), marking it as seen.
- Check the notification icon in minerva. At this point, you should see
notification displayed as unseen.

The reason bug appeared in the first place is that alert/notice timestamps
were mixed up when seen time is obtained. We get seen time from
EchoSeenTime class, where we get smaller of the two timestamps,
using PHP method `min()`. See I27109ee6a248. Then, we get last unread
notification timestamp (which can be either alert or notice), and compare
that to seen time. That leads to the situation when you have only one of
alerts or notices with unread items, smaller timestamp is used for seen,
and most recent for unread, at which point we compare timestamps for
two separate things.

Previous behavior of getting seen timestamps (using max instead of min) would
probably solve the problem, but some other inconsistencies might arrise.
This should prevent any weird and unpredictable behavior to happen.

Bug: T183076
Change-Id: I20bbd6c590086b1c3eccf82983aad59eb3144a7a
2018-01-18 14:18:56 +01:00
..
ICustomizableSkin.php build: Updating mediawiki/mediawiki-codesniffer to 0.10.1 2017-07-24 18:53:04 +02:00
MenuBuilder.php Improve some parameter docs 2017-10-05 19:17:38 +02:00
MinervaTemplate.php Hygiene: Refactor Minerva history link generation 2017-11-27 14:27:11 -08:00
SkinMinerva.php Fix seen notifications appearing as unseen on mobile 2018-01-18 14:18:56 +01:00
SkinUserPageHelper.php Minerva is its own skin 2017-07-12 08:12:40 -07:00
banners.mustache Minerva is its own skin 2017-07-12 08:12:40 -07:00
footer.mustache Minerva is its own skin 2017-07-12 08:12:40 -07:00
history.mustache Hygiene: Refactor Minerva history link generation 2017-11-27 14:27:11 -08:00
ie8Html5Support.mustache Minerva is its own skin 2017-07-12 08:12:40 -07:00
minerva.mustache Hygiene: Refactor Minerva history link generation 2017-11-27 14:27:11 -08:00
secondaryButton.mustache Notification icon should not show NaN for persian Wikipedia 2017-10-26 20:27:12 +00:00
user_page_links.mustache Minerva is its own skin 2017-07-12 08:12:40 -07:00