diff --git a/includes/api/ApiEchoMarkSeen.php b/includes/api/ApiEchoMarkSeen.php old mode 100644 new mode 100755 index e23204faf..6b3797318 --- a/includes/api/ApiEchoMarkSeen.php +++ b/includes/api/ApiEchoMarkSeen.php @@ -11,9 +11,14 @@ class ApiEchoMarkSeen extends ApiBase { $this->dieUsage( 'Login is required', 'login-required' ); } + // Load from the master to reduce CAS errors from high update frequency + $u = User::newFromId( $user->getId() ); + $u->load( User::READ_LATEST ); + $timestamp = wfTimestamp( TS_MW ); - $user->setOption( 'echo-seen-time', $timestamp ); - $user->saveSettings(); + // @TODO: do not abuse user preferences for "last seen" + $u->setOption( 'echo-seen-time', $timestamp ); + $u->saveSettings(); $this->getResult()->addValue( 'query', $this->getModuleName(), array( 'result' => 'success',