Merge "ApiSetNotificationTimestamp: Make entirewatchlist more efficient"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 17 Jan 2019 18:04:46 +0000 (18:04 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 17 Jan 2019 18:04:46 +0000 (18:04 +0000)
RELEASE-NOTES-1.33
includes/api/ApiSetNotificationTimestamp.php

index 0f8614e..80e3bbd 100644 (file)
@@ -79,6 +79,8 @@ production.
 * (T212356) When using action=delete on pages with many revisions, the module
   may return a boolean-true 'scheduled' and no 'logid'. This signifies that the
   deletion will be processed via the job queue.
+* action=setnotificationtimestamp will now update the watchlist asynchronously
+  if entirewatchlist is set, so updates may not be visible immediately
 
 === Action API internal changes in 1.33 ===
 * A number of deprecated methods for API documentation, intended for overriding
index b81c5bf..41c207b 100644 (file)
@@ -108,10 +108,14 @@ class ApiSetNotificationTimestamp extends ApiBase {
                $result = [];
                if ( $params['entirewatchlist'] ) {
                        // Entire watchlist mode: Just update the thing and return a success indicator
-                       $watchedItemStore->setNotificationTimestampsForUser(
-                               $user,
-                               $timestamp
-                       );
+                       if ( is_null( $timestamp ) ) {
+                               $watchedItemStore->resetAllNotificationTimestampsForUser( $user );
+                       } else {
+                               $watchedItemStore->setNotificationTimestampsForUser(
+                                       $user,
+                                       $timestamp
+                               );
+                       }
 
                        $result['notificationtimestamp'] = is_null( $timestamp )
                                ? ''