Background
Since the actor migration, users are associated with a user ID and an actor ID. These are stored in the actor table, as actor_user and actor_id, respectively.
IPInfo's Logger inserts log entries via ManualLogEntry. When log entries are created, they use the actor ID to identify the performer.
Logger::debouncedLog looks up whether a log row has already been made for a given user within a given time period; however, it checks for the user ID.
Therefore, for any user whose actor ID and user ID are different, the logger doesn't debounce correctly.
Steps to reproduce
This assumes the user Admin has an actor ID different from their user ID.
Attempt to log the same action several times using MediaWiki's PHP shell (php maintenance/shell.php) with steps along these lines:
$performer = User::newFromName( 'Admin' ); $loggerFactory = \MediaWiki\MediaWikiServices::getInstance()->get( 'IPInfoLoggerFactory' ); $logger = $loggerFactory->getLogger(); $logger->logViewInfobox( $performer, '127.0.0.1' ); // Default debounce time is 24 hours $logger->logViewInfobox( $performer, '127.0.0.1' ); // Shouldn't log anything to the database, but does
How to fix
Logger::debouncedLog should check for the actor ID.