Page MenuHomePhabricator

Block notice is not shown when editing from mobile for composite blocks
Closed, ResolvedPublic

Description

Steps to reproduce:

  • Block an IP address with two different range blocks
  • Attempt to edit from mobile while logged out, from that IP address

Expected:

  • See a block error message

Actual:

  • You are allowed to progress to the editor. If you attempt to save an edit, you will see a generic error, with no block details

To fix this, the error message key for composite blocks should be registered with ApiBase::blockMsgMap.

Event Timeline

Tchanders created this task.Jul 3 2019, 6:44 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 3 2019, 6:44 AM

Change 520376 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] Fix API message maps for block errors

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

Change 520376 merged by jenkins-bot:
[mediawiki/core@master] Fix API message maps for block errors

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

dom_walden added a subscriber: dom_walden.

Actual:

  • You are allowed to progress to the editor. If you attempt to save an edit, you will see a generic error, with no block details

I don't see this, apart from the circumstances I describe in T227168#5308317.

Comparing en.m.wikipedia.beta.wmflabs.org to test.m.wikipedia.org.

Test:


The API response:

{"error":{"code":"blockedtext-composite","info":"Your username or IP address has been blocked. The reason given is: :There are multiple blocks against your account and/or IP address. * Start of block: 12:31, 5 July 2019 * Expiration of longest block: 14:31, 5 July 2019 Your current IP address is 2001:8b0:7acf:5d4e:22cf:30ff:fe4e:1d46. Please include all above details in any queries you make.","docref":"See https://test.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1317"}

Beta:


API response:

{"error":{"code":"blocked","info":"You have been blocked from editing.","blockinfo":{"blockid":null,"blockedby":"MediaWiki default","blockedbyid":12508,"blockreason":"There are multiple blocks against your account and/or IP address","blockedtimestamp":"2019-07-05T12:21:24Z","blockexpiry":"2019-07-05T15:21:14Z","blockpartial":true},"docref":"See https://en.wikipedia.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"deployment-mediawiki-09"}

I am assuming the latter is better than the former, because it may be easier to parse the json.

@dom_walden Just to clarify - the beta has the generic message in your screenshot above - shouldn't it be the other way around? Beta should be running the more recent code.

@dom_walden Just to clarify - the beta has the generic message in your screenshot above - shouldn't it be the other way around? Beta should be running the more recent code.

Beta does now have a generic error message (in the UI).

I had assumed that was intentional. I am guessing the MobileFrontend just prints the value of the "info" key of the API response, which no longer includes all the information of the block.

Now that you point this out it seems less satisfactory. MobileFrontend might need to be updated to print a more useful block message to the user. Would you like me to raise a bug? I think this is one of a couple of circumstances where the mobile block error is not very helpful (indeed, bugs may already exist, e.g. T189717). Thanks for pointing this out.

dbarratt closed this task as Resolved.Jul 16 2019, 6:15 PM