watchlist: make getLatestNotificationTimestamp() method use the correct user
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 21 May 2019 00:32:41 +0000 (17:32 -0700)
committerKrinkle <krinklemail@gmail.com>
Tue, 21 May 2019 00:49:36 +0000 (00:49 +0000)
This uses the proper stash entry and also fits within the 3 item process
cache in WatchedItemStore that contains last-visit maps for users.

Follows-up 588a46468252, which added use of the stash optimisation but
wrongly keyed against rc_actor/rc_user instead of $this->getUser,
which means that unlike the DB 'wl_notificationtimestamp' field (which
is result of joining against watchlist and user via $this->getUser), it
was now reading the cache key for a different user instead of the user
that is viewing their watchlist.

Bug: T218511
Bug: T223310
Change-Id: I5c4dd2c7384f7681cee21fb2caf10d4d4b64c724

includes/specials/SpecialWatchlist.php

index 56f5c8f..2443470 100644 (file)
@@ -880,7 +880,7 @@ class SpecialWatchlist extends ChangesListSpecialPage {
        private function getLatestNotificationTimestamp( RecentChange $rc ) {
                return $this->watchStore->getLatestNotificationTimestamp(
                        $rc->getAttribute( 'wl_notificationtimestamp' ),
-                       $rc->getPerformer(),
+                       $this->getUser(),
                        $rc->getTitle()
                );
        }