Page MenuHomePhabricator

Global user pages cannot be viewed in rest api (404)
Closed, DeclinedPublic

Event Timeline

Nirmos created this task.Jan 13 2018, 10:13 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 13 2018, 10:13 PM
mobrovac triaged this task as Medium priority.Jan 15 2018, 10:11 AM
mobrovac edited projects, added Services (later); removed Parsoid.
Pchelolo added a project: Parsoid.EditedJan 17 2018, 9:49 PM
Pchelolo added a subscriber: Pchelolo.

The root cause of the issue is that RESTBase and Parsoid contact MediaWiki query API to get the revision information for the title and then use this info for access checks and much more, like meta headers in Parsoid HTML. Global user pages don't have any revisions on the local wiki, so neither RESTBase nor Parsoid can process them.

There's a bunch of namespaces that RESTBase doesn't render for, Special for example. What's your use-case for Parsoid HTML for the global user pages?

It's not that I want this or that there's any use case. ssastry and I were investigating in T161546 whether TemplateStyles would make that task obsolete. If you read that task, maybe it will make sense.

Pchelolo added a subscriber: ssastry.EditedJan 17 2018, 10:51 PM

We've chatted with @ssastry as well about this and this will be needed when/if we start using Parsoid HTML for page views, so no immediate necessity to fix this.

One possible path which I personally think we should follow is to detect that it's a User namespace and in case it's a global user page send back a 302 redirect to the actual location of the user page. We do the same for files from commons when they're accessed via an individual project and the approach is good, although for File pages it's pretty easy to find out the sharedRepoURL by a simple MW API call. For the global user pages, the location is controlled by the wgGlobalUserPageDBname config parameter that is not exposed via the API as far as I can tell. That means we will probably need to hardcode meta.wikimedia.org in the redirects and it's not a very elegant solution.

Pchelolo closed this task as Declined.Aug 5 2019, 4:16 PM

It's not that I want this or that there's any use case. ssastry and I were investigating in T161546 whether TemplateStyles would make that task obsolete. If you read that task, maybe it will make sense.

Given that there's no specific use-case currently and that everything is changing a lot when Parsoid is ported to PHP, I will close this as Declined. Please feel free to reopen if there's a need for this.