ItamarWMDE added a comment.

  Original Ticket
  ---------------
  
  (as written by @Lucas_Werkmeister)
  
  WikibaseClient wblistentityusage API module adds to pages output when not 
used as generator, potentially throws RuntimeException
  
  I’ve noticed that the `list=wblistentityusage` API, when it’s not used as a 
generator, still adds its pages to the `pages` output container in the result. 
This is confusing – usually, list modules have their own output container, and 
`pages` is reserved for  `titles`/`pageids`/`revids` and `generator`. See this 
output for list=wblistentityusage, list=allpages, titles=Q1 
<https://www.wikidata.org/w/api.php?action=query&format=json&list=wblistentityusage%7Callpages&titles=Q1&wbeuentities=Q1&wbeulimit=1&aplimit=1>:
  
    {
        "batchcomplete": "",
        "continue": {
            "wbeucontinue": "708|Q1|C.P969",
            "apcontinue": "Q100",
            "continue": "-||"
        },
        "query": {
            "pages": {
                "129": {
                    "pageid": 129,
                    "ns": 0,
                    "title": "Q1"
                },
                "578": {
                    "ns": 2,
                    "title": "User:Yiyi",
                    "pageid": 578,
                    "wblistentityusage": {
                        "Q1": {
                            "aspects": [
                                "L"
                            ]
                        }
                    }
                }
            },
            "allpages": [
                {
                    "pageid": 129,
                    "ns": 0,
                    "title": "Q1"
                }
            ]
        }
    }
  
  `list=allpages`’ output is under `allpages`; `pages` contains two pages that 
look different and come from different sources, `Q1` from `titles=Q1` and 
`User:Yiyi` from `list=wblistentityusage`.
  
  If you force a collision between the two kinds of `pages`, it gets worse. 
Item Q1000011 happens to only be used on a single page, User 
talk:Epìdosis/Archive/2019; 
wbeuentities=Q1000011&titles=User_talk:Epìdosis/Archive/2019 
<https://www.wikidata.org/w/api.php?action=query&format=json&list=wblistentityusage&titles=User_talk%3AEp%C3%ACdosis%2FArchive%2F2019&wbeuentities=Q1000011>,
 which would therefore add the page to `pages` from both sources, produces an 
exception:
  
  counterexample
    {
        "error": {
            "code": "internal_api_error_RuntimeException",
            "info": "[267db349-f489-482e-9a01-1d2e6e66654d] Caught exception of 
type RuntimeException",
            "errorclass": "RuntimeException"
        },
        "servedby": "mw1392"
    }
  
  Note that this API module as already known to crash when used as a generator: 
T254334: WikibaseClient wblistentityusage API module throws RuntimeException 
when used as generator <https://phabricator.wikimedia.org/T254334>

TASK DETAIL
  https://phabricator.wikimedia.org/T300460

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: ItamarWMDE
Cc: Lucas_Werkmeister_WMDE, ItamarWMDE, Nikki, Aklapper, Astuthiodit_1, 
karapayneWMDE, Invadibot, maantietaja, Akuckartz, darthmon_wmde, Rosalie_WMDE, 
WDoranWMF, DannyS712, Nandana, lucamauri, Amorymeltzer, Lahi, Gq86, 
GoranSMilovanovic, QZanden, LawExplorer, Sethakill, dg711, _jensen, rosalieper, 
Scott_WUaS, Verdy_p, Wikidata-bugs, aude, jayvdb, Jdforrester-WMF, Mbch331, 
Jay8g
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to