Page MenuHomePhabricator

Contribution pages for unregistered usernames should not show HTML 404 if there are any imported contributions
Closed, DeclinedPublic

Description

Contribution pages for unregistered usernames should not show HTML 404 if there are any revisions listed on the page, possibly imported from other wikis.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 28 2017, 3:30 PM
This comment was removed by SamanthaNguyen.

@GeoffreyT2000: Please follow https://www.mediawiki.org/wiki/How_to_report_a_bug and always provide clear steps to reproduce / a testcase which will allow any other person to follow these steps (without having to interpret those steps) and see the same results.
Problems that others can reliably reproduce can get fixed faster.

For example, when I go to https://en.wikipedia.org/wiki/Special:Contributions/Pernak, contributions to User:Dan Koehl/Vyškov Zoo are listed there. The page does not appear in the history in Internet Explorer, so I suspect that an HTTP 404 code must have occurred.

@GeoffreyT2000: Where can the HTML 404 error be seen exactly? Please provide clear steps to reproduce the problem, step by step.

The 404 status code is sent when visiting the contributions page; it just can't be seen. A modification needs to be made to the "contributionsSub" function under includes/specials/SpecialContributions.php. The condition for generating the status code needs to be something other than "!$this->including()".

$ curl -I https://en.wikipedia.org/wiki/Special:Contributions/Pernak
HTTP/1.1 404 Not Found
Date: Mon, 30 Jan 2017 23:11:52 GMT
Content-Type: text/html; charset=UTF-8
...

Change 343230 had a related patch set uploaded (by GeoffreyT2000):
[mediawiki/core] Don't show 404 status code for unregistered users unless there are actually no contribs listed at all

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

Krinkle added subscribers: matmarex, Krinkle.EditedMar 17 2017, 2:04 AM

@GeoffreyT2000: Where can the HTML 404 error be seen exactly?

@matmarex showed how to see the error code from the command-line. But I wanted to briefly explain what this means for the end-user.

While error codes are usually reserved for major errors like accessing a file that doesn't exist, any MediaWiki response can also set the internal error code flags (404, 400 and others). We do this for example when visiting a red link (index.php exists, but the article specified doesn't), or when going to an invalid action (e.g. ?action=foo). While this is mostly invisible and seemingly unimportant, it does have various real impacts that affect users:

  • Error pages don't get indexed by search engines.
  • Error pages either don't get cached or only cached for a short-time by our CDN infrastructure.
  • In Chrome, for example, error pages are not added to your browsing history. Thus making it difficult to find it again later. (But also avoids autocompleting a url you probably don't want to visit, especially if it was a typo).

The above all apply to red links, invalid action links, and also contribution searches for user names that don't exist.


PS: Error codes can also be seen within the a browser from the developer tools or browser inspector. For example:

Change 343230 abandoned by GeoffreyT2000:
Don't show 404 status code for unregistered users unless there are actually no contribs listed at all

Reason:
Don't know how to fix this further, so I'm abandoning this for now.

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

GeoffreyT2000 closed this task as Declined.Feb 25 2018, 4:29 PM

No longer relevant now that T181731 has been run.