Background
When a user accesses IP information returned by the LogHandler or RevisionHandler API endpoints, the fact that they accesses this information is logged. The log includes the time of access and whether the user saw partial or full information.
The log happens via a job, in accordance with the guidance found here:
Instead of a DeferredUpdate, use a job for writing data in the context of a GET request.
Two problems with the current implementation were raised in T295017#7729296 and T295017#7729314:
- The timestamp of the log entry is the time at which the job runs. If there are delays in the job queue, this could be a lot later than the time when the user accessed the IP information.
- Whether the user saw basic or full information is determined by their permissions at the time when the job runs, which may be different from their permissions when they accessed the IP information.
We can fix both of these by passing the time and access level to the job as parameters (similar to how the performer, IP and data context are passed):
$this->jobQueueGroup->push( new JobSpecification( 'ipinfoLogIPInfoAccess', [ 'performer' => $user->getName(), 'ip' => $author->getName(), 'dataContext' => $dataContext ], [], null ) );
AC
- Timestamp and access level are passed to LogIPInfoAccessJob
- The Logger logs the passed-through values