Page MenuHomePhabricator

Userinfo API: Blockinfo for partial blocks should include block settings
Open, LowPublicFeature

Description

Steps to reproduce:

  • Partially block a user
  • Retrieve blockinfo via API

Example result:

{
    "batchcomplete": true,
    "query": {
        "userinfo": {
            "id": 15982,
            "name": "DannyS712",
            "blockid": 8097,
            "blockedby": "DannyS712",
            "blockedbyid": 15982,
            "blockreason": "test",
            "blockedtimestamp": "2019-10-25T19:54:02Z",
            "blockexpiry": "2019-10-25T22:54:02Z",
            "blockpartial": true
        }
    }
}

expected result: since the block is a partial block, the page(s)/namespace(s) that the user is blocked from are also given
actual result: no info given

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Anomie subscribed.

Since the same method is used here as for most block error messages, we should probably not add the additional information unconditionally in ApiBlockInfoTrait.

Alternatively, a client could probably take the returned block ID and use action=query&list=blocks to look up the additional information if it cares.

WDoranWMF moved this task from Triage Meeting Inbox to Icebox on the Platform Engineering board.

TODO: Add unblocked user response to description to demonstrate the difference between the two responses

In an attempt to summarize the discussion in Code Mob today, on investigation, there are several options for returning the pages/namespace(s) blocked from a user as part of the BlockInfo endpoint. Potentially, we could:

  1. Serialize restriction array to JSON in order to return the type of restriction and value
  1. Pull information from LogEntry, if it's tractable for the API to include log events in BlockInfo
  1. Direct the user to query the log directly, to see relevant information on the pages restricted, as in action=query&list=logevents

In order to choose a path forward, should know use case and context for inclusion of partial block settings in BlockInfo

FGoodwin changed the subtype of this task from "Task" to "Feature Request".Aug 25 2023, 2:38 PM