Go to file
Dreamy Jazz a5b68cf46d Don't attempt to steal or create the FilterUser in CheckUserHandler
Why:
* When CheckUser asks the AbuseFilter extension for modifications
  to rows inserted into the CheckUser tables, the AbuseFilter
  extension attempts to get the Filter user via User::newSystemUser
* User::newSystemUser can deadlock if multiple requests to create
  the system user are being made at once.
* The CheckUserHander does not need to create the abuse filter system
  and instead only needs to know if a given $user is the equal to
  the FilterUser.
* As such the FilterUser service needs to provide a way to check if
  a given $user is equal without creating the FilterUser.

What:
* Add FilterUser::isUserSameAs which returns a boolean value
  indicating whether the Abuse Filter system user is the equal
  to a given UserIdentity in the same way that UserIdentity::equals
  is implemented.
* Refactor ::getUser to get the username for the filter user in
  a separate method, so that the ::isUserSameAs method can also
  use this method. Name this new method ::getFilterUserName.
* Add a test for the FilterUser service to ensure consistent test
  coverage
* Convert the @covers and @coversDefaultClass annotations to be
  a @covers for the class. This is because PHPUnit recommends this in
  https://docs.phpunit.de/en/9.6/annotations.html#appendixes-annotations-covers-tables-annotations

Bug: T356275
Bug: T346967
Change-Id: I8a101781bb47612deabb0f2a06a398ac13e860e6
2024-01-31 19:32:52 +00:00
.phan Use HookHandlers for UserMerge hook 2023-08-16 09:44:30 +02:00
db_patches Drop some ancient schema changes 2023-12-22 02:07:48 +00:00
i18n Localisation updates from https://translatewiki.net. 2024-01-31 08:28:29 +01:00
includes Don't attempt to steal or create the FilterUser in CheckUserHandler 2024-01-31 19:32:52 +00:00
maintenance Remove old maintenance scripts 2024-01-18 05:50:19 +00:00
modules Move var declarations inline 2023-11-10 18:27:55 +00:00
tests Don't attempt to steal or create the FilterUser in CheckUserHandler 2024-01-31 19:32:52 +00:00
.eslintignore build: Update linters 2023-11-08 14:05:03 +00:00
.eslintrc.json build: Update linters 2022-03-17 22:19:08 +00:00
.gitignore Add config for Selenium and basic tests 2019-09-17 16:23:07 +00:00
.gitreview Whoops, track not trace 2016-10-24 17:01:30 -07:00
.phpcs.xml Merge "Use FauxRequest::setUpload in AbuseFilterUploadTestTrait::doUpload" 2021-05-15 12:22:10 +00:00
.stylelintrc.json build: Update linters 2023-11-08 14:05:03 +00:00
AbuseFilter.alias.php Add Bengali translation of BlockedExternalDomains 2023-08-19 11:05:33 +00:00
CODE_OF_CONDUCT.md build: Updating mediawiki/phan-taint-check-plugin to 1.4.0 2018-09-01 05:29:54 +00:00
composer.json composer: Require wikimedia/equivset 1.6.1, which will ship with MW 1.42+ 2024-01-24 21:53:03 +00:00
COPYING Add COPYING 2014-01-22 21:21:10 +00:00
extension.json extension.json: Drop RL targets definitions, no longer honoured 2024-01-12 08:38:57 -05:00
Gruntfile.js build: Run stylelint for less file 2023-11-28 20:06:41 +01:00
package-lock.json build: Update linters 2023-11-08 14:05:03 +00:00
package.json build: Update linters 2023-11-08 14:05:03 +00:00