Page MenuHomePhabricator

Mobile block notice not showing block reason or block log entry for global blocks
Open, MediumPublic

Description

Recently, while trying to edit anonymously from my phone, I encountered the following error message:


When I clicked on 'Details', it took me to the following page:

It looks like two things are broken here:

  • The block reason isn't listed on the first screen. Instead it just says "Unknown reason".
  • The IP address loaded into Special:BlockList is "#null" rather than my IP address.

I was editing from an IPv6 address via T-mobile. You can see all of the block info for this address at the top of:
https://en.wikipedia.org/wiki/Special:Contributions/2607:fb90:1111:1111:1111:1111:1111:1111

For posterity:

This IP address is currently blocked. The latest block log entry is provided below for reference:

15:31, 3 August 2019 TonyBallioni talk contribs changed block settings for 2607:fb90::/32 talk with an expiration time of 23:51, 17 July 2020 (anon. only, account creation blocked, cannot edit own talk page) ({{TMOblock}}: <!--ACC ignore-->)

This IP address is currently globally blocked. If the block is marked as locally disabled, this means that it applies on other sites, but a local administrator has decided to disable it on this wiki. The global block log entry is provided below for reference:

12:47, 28 July 2019: علاء (meta.wikimedia.org) globally blocked 2607:FB90:0:0:0:0:0:0/32 (expires on 28 October 2019 at 12:45, anonymous only) (Cross-wiki vandalism: If you cannot edit, please contact Stewards)

I'm guessing that the reason why it had problems is either because the address is globally blocked or because it is both globally blocked and locally blocked.

Details

Related Gerrit Patches:
mediawiki/extensions/GlobalBlocking : masterSet block parameters on GlobalBlock object to fix error message
mediawiki/extensions/MobileFrontend : masterRemove link from block message drawer for blocks with no ID

Event Timeline

kaldari created this task.Sep 26 2019, 10:40 PM
Restricted Application added subscribers: Liuxinyu970226, MGChecker, Aklapper. · View Herald TranscriptSep 26 2019, 10:40 PM
Jdlrobson moved this task from Needs triage to Triaged on the Mobile board.Sep 27 2019, 6:28 PM
Niharika triaged this task as Medium priority.Sep 30 2019, 7:06 PM

The problem seems to be that only the global block is being reported, but not the local block (e.g. see the reported blocker name).

  • The block reason isn't listed on the first screen. Instead it just says "Unknown reason".

"Unknown reason" is the en translation for mobile-frontend-editor-generic-block-reason, used when there's no reason given, which appears to be the case with the global block.

  • The IP address loaded into Special:BlockList is "#null" rather than my IP address.

A similar problem is seen for any block that's not an ordinary DatabaseBlock, and we should address this in T225939. (See also https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/324202/.)

Why it's only reporting the global block

Were you using the visual editor @kaldari? ApiVisualEditor reports a global block once it finds one, and doesn't look for any other blocks: https://gerrit.wikimedia.org/g/mediawiki/extensions/VisualEditor/+/refs/changes/21/475921/4/includes/ApiVisualEditor.php#537 It's not the only place that does this, and maybe we should look into making a CompositeBlock in these situations instead, so details of both blocks can be reported.

I was probably using VE, since I usually use VE on mobile unless it's something that specifically requires Wikitext editing.

@Tchanders - The reason provided for the global block was "Cross-wiki vandalism: If you cannot edit, please contact Stewards", although I'm not sure if that is stored in the same way that local block reasons are.

The reason provided for the global block was [...]

@kaldari Quite right - not sure how I missed that!

As mentioned above, we should consider how to show block errors when there are multiple blocks, one of which is a global block. But before that, here are some thoughts on improving the block message for a single global block.

Empty reason

Problem:
API users expect to be able to make a block message using the details provided by ApiBlockInfoTrait::getBlockDetails. However, most block properties are not set on a GlobalBlock; instead it sets an $error property, with the expectation that the customized message will always be displayed in full. Since the mobile extensions use the block details rather than the full message, they are unable to display a useful message for global blocks. (With our work on block error messages - T227174 - we are trying to encourage block errors to be built in a more standard way, starting from the block properties.)

Fix:
Set the properties properly on a GlobalBlock.

Unhelpful Details link

Problem:
The null ID is also because the GlobalBlock does not set a property - $mId in this case. The front-end builds a link to Special:BlockList, with the block ID it is given. However, GlobalBlocks cannot provide a useful ID - they are like SystemBlocks in that they are not stored in the local ipblocks table. Linking to Special:BlockList with the ID from the globalblocks table would of course not help.

Fix:
As a first step we should remove the Details link for blocks with a null ID. The message would be just as helpful as the current message, and less confusing.

A longer term fix that actually improves the helpfulness of the message should be considered with T225939, since we have the same problem for SystemBlocks in general.

Change 545939 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/MobileFrontend@master] Remove link from block message drawer for blocks with no ID

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

Change 545939 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Remove link from block message drawer for blocks with no ID

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

@Niharika, @ppelberg - It looks like both the AHT team and the Editing team have marked this bug as external. Does that mean that no one is going to work on it? Just curious, not pushing for this to be prioritized.

Change 547346 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/GlobalBlocking@master] Set block parameters on GlobalBlock object to fix error message

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

@Tchanders Should we poke more people for code review on this?

@Niharika I'd say this is more in AHT's domain, but perhaps we could also ask @Esanders since it affects VisualEditor too.

Change 547346 merged by jenkins-bot:
[mediawiki/extensions/GlobalBlocking@master] Set block parameters on GlobalBlock object to fix error message

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