Page MenuHomePhabricator

System and Composite blocks don't always report correct anonymous value
Closed, ResolvedPublic3 Estimated Story PointsOct 6 2020

Description

What is the problem?

When looking up information about System and Composite blocks via the API, it does not return blockanononly.

This means, for example, mobile messages always treat them as softblocks, even if they aren't (T259774#6411299).

Steps to reproduce problem
  1. Create an anonymous system or composite block, e.g.
    1. 2 anon. IP block ranges covering the same IP
    2. $wgSoftBlockRanges, if you have access to the wiki's config.
  2. On the blocked IP, visit /w/api.php?action=query&format=json&formatversion=2&prop=revisions|info&rvprop=content|timestamp&titles=Vnphyyblfr24&intestactions=edit&intestactionsdetail=full and look at the blockinfo array

Expected behavior: See blockanononly in the array
Observed behavior: Don't see blockanononly in the array

Environment

Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.36.0-alpha (0e9937c) 07:48, 31 August 2020.

Proposed Solution
  1. Move DatabaseBlock::isHardblock() to AbstractBlock::isHardblock() and return a default value of false. (Deprecate/Remove the setter at the same time?)
  2. Update ComposeiteBlock to handle isHardblock()
  3. Update various SystemBlocks to correctly report their hardblock status (i.e. check proxy and tor blocks).

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptAug 31 2020, 2:00 PM
ARamirez_WMF set the point value for this task to 3.Sep 9 2020, 4:39 PM
Niharika triaged this task as Medium priority.Sep 9 2020, 4:41 PM
dbarratt updated the task description. (Show Details)Sep 10 2020, 2:52 PM
ARamirez_WMF changed the subtype of this task from "Bug Report" to "Deadline".Sep 30 2020, 4:06 PM
ARamirez_WMF set Due Date to Oct 6 2020, 4:00 AM.

Change 631793 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] Move $isHardblock property up to AbstractBlock from DatabaseBlock

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

Change 631793 merged by jenkins-bot:
[mediawiki/core@master] Move $isHardblock property up to AbstractBlock from DatabaseBlock

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

Soft System and Composite blocks made up of all soft blocks now report:

"blockanononly": true

Hard System and Composite blocks made up of at least one hard block report:

"blockanononly": false

Mobile block messages now show the correct message for System and Composite blocks.

I briefly tested that soft System and soft Composite blocks only blocked the actions of logged out users, and hard System and hard Composite blocks block all users.

Test Environment: Local vagrant MediaWiki 1.36.0-alpha (c91beb7)

Tchanders closed this task as Resolved.Dec 3 2020, 1:14 PM