Merge "Revert "Pass revision being reverted to edit code""
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 27 Mar 2018 14:23:20 +0000 (14:23 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 27 Mar 2018 14:23:20 +0000 (14:23 +0000)
1  2 
includes/page/WikiPage.php

@@@ -26,6 -26,7 +26,6 @@@ use MediaWiki\MediaWikiServices
  use Wikimedia\Assert\Assert;
  use Wikimedia\Rdbms\FakeResultWrapper;
  use Wikimedia\Rdbms\IDatabase;
 -use Wikimedia\Rdbms\DBError;
  use Wikimedia\Rdbms\DBUnexpectedError;
  
  /**
@@@ -1146,16 -1147,14 +1146,16 @@@ class WikiPage implements Page, IDBAcce
                        return;
                }
  
 -              Hooks::run( 'PageViewUpdates', [ $this, $user ] );
 -              // Update newtalk / watchlist notification status
 -              try {
 -                      $user->clearNotification( $this->mTitle, $oldid );
 -              } catch ( DBError $e ) {
 -                      // Avoid outage if the master is not reachable
 -                      MWExceptionHandler::logException( $e );
 -              }
 +              // Update newtalk / watchlist notification status;
 +              // Avoid outage if the master is not reachable by using a deferred updated
 +              DeferredUpdates::addCallableUpdate(
 +                      function () use ( $user, $oldid ) {
 +                              Hooks::run( 'PageViewUpdates', [ $this, $user ] );
 +
 +                              $user->clearNotification( $this->mTitle, $oldid );
 +                      },
 +                      DeferredUpdates::PRESEND
 +              );
        }
  
        /**
                        $target->getId(),
                        $guser,
                        null,
-                       $tags,
-                       $current->getId()
+                       $tags
                );
  
                // Set patrolling and bot flag on the edits, which gets rollbacked.