Page MenuHomePhabricator

Remove GlobalBlockingHooks::onGetUserPermissionsErrorsExpensive in favour of GlobalBlockingHooks::onGetUserBlock
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

GlobalBlocking's handler for the GetUserPermissionsErrorsExpensive hook is no longer needed, now that global blocks are added via the GetUserBlock hook, since T257701: Add global blocks into CompositeBlocks rather than treating them separately.

Why is it no longer needed?

At the moment, if a globally blocked user tries to edit, their block is found twice, via the permission and the block checks:

two_block_messages.png (439ร—1 px, 96 KB)

Acceptance criteria
  • A globally blocked user is still unable to edit
  • A globally blocked user sees only one block message, if they only have a global block

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptNov 11 2022, 5:41 PM
ARamirez_WMF renamed this task from Remove GlobalBlockingHooks::onGetUserPermissionsErrorsExpensive in favour of GlobalBlockingHooks::onGetUserBlock to Investigate: Remove GlobalBlockingHooks::onGetUserPermissionsErrorsExpensive in favour of GlobalBlockingHooks::onGetUserBlock.Nov 22 2022, 6:51 PM
Tchanders renamed this task from Investigate: Remove GlobalBlockingHooks::onGetUserPermissionsErrorsExpensive in favour of GlobalBlockingHooks::onGetUserBlock to Remove GlobalBlockingHooks::onGetUserPermissionsErrorsExpensive in favour of GlobalBlockingHooks::onGetUserBlock.Nov 28 2022, 4:01 PM
Tchanders set the point value for this task to 3.

Change 861421 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/GlobalBlocking@master] Remove GlobalBlockingHooks::onGetUserPermissionsErrorsExpensive

https://gerrit.wikimedia.org/r/861421

I investigated whether it was safe to remove this hook handler. I believe it is, based on the logic from the task description, so have written a patch for it. Reviewers should confirm that it is safe to remove this handler.

Change 861421 merged by jenkins-bot:

[mediawiki/extensions/GlobalBlocking@master] Remove GlobalBlockingHooks::onGetUserPermissionsErrorsExpensive

https://gerrit.wikimedia.org/r/861421

@Tchanders I validated that I was receiving a single block message when trying to edit. I tested global block IP, range, XFF, local sitewide, and composite blocks as seen in the screenshots below. Please let me know if there is any other testing that you want me to do. If not, is it ok for me to move this to Done?

Test Environment: Local
Browser: Chrome

Global Block IP

T322941_GB_Edit_GB_IP_Chrome.png (587ร—2 px, 203 KB)

Global Block IP Range

T322941_GB_Edit_RangeIP_Chrome.png (560ร—2 px, 213 KB)

Global Block IP XFF

T322941_GB_Edit_XFF_Chrome.png (550ร—2 px, 198 KB)

Local Block Sitewide

T322941_GB_Edit_Sitewide_Chrome.png (561ร—2 px, 197 KB)

Composite Block

T322941_GB_Edit_Composite_Chrome.png (578ร—2 px, 188 KB)