Page MenuHomePhabricator

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

Event Timeline

mobrovac edited projects, added Services (later); removed Parsoid.
Pchelolo subscribed.

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.

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.

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.