Page MenuHomePhabricator

Improve appearance of Special:MobileDiff when looking for invalid revision (Maybe because it's deleted)
Closed, ResolvedPublic5 Estimate Story Points

Description

When you click a link to deleted (or just nonexistent) revision on the web, MediaWiki:Difference-missing-revision is shown which explains what happened.

But when you click the same link in mobile view, it shows unhelpful plain error message:
Bad revision. The ID for the revision you requested does not exist.

Developer notes

The problem is located in SpecialMobileDiff::executeWhenAvailable() function. When $rev is null (no revision found), instead of normal flow system calls
wfHttpError( 404, title, text ); and returns early. wfHttpError function returns the error in oldchool/ugly way without any layout (as it says, it's simple http errror.

Code:

	public function executeWhenAvailable( $par ) {
                [...]
		$revisions = $this->getRevisionsToCompare( explode( '...', $par, 2 ) );
		list( $prev, $rev ) = $revisions;

		if ( $rev === null ) {
			$this->executeBadQuery();
			return false;
		}
                [...]
         }

        /**
	 * Generate a 404 Error message, that revisions can not be found
	 */
	public function executeBadQuery() {
		wfHttpError( 404, $this->msg( 'mobile-frontend-diffview-404-title' )->text(),
			$this->msg( 'mobile-frontend-diffview-404-desc' )->text() );
	}

Instead please use $this->showPageNotFound(). TheSpecialMobileDiff should override errorNotFoundDescriptionMsg and errorNotFoundTitleMsg properties.

Acceptance criteria
  • When $revision is not found system outputs nice error page
  • wfHttpError() is not used

QA

Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MobileDiff/898964501898964501

This should show a friendly error message in the Minerva skin. It should not show a blank white page with the text "The ID for the revision you requested does not exist."

QA results

T224430#5722992

Details

Related Gerrit Patches:
mediawiki/extensions/MobileFrontend : masterShow a nice error message for invalid revisions

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
ResolvedAbit
OpenNone
OpenNone
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
StalledNone
ResolvedPetrb
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedAmmarpad

Event Timeline

Ammarpad created this task.May 27 2019, 3:32 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 27 2019, 3:32 PM
ovasileva triaged this task as High priority.May 29 2019, 4:55 PM
pmiazga updated the task description. (Show Details)Jun 4 2019, 1:55 PM
pmiazga moved this task from Needs Prioritization to Upcoming on the Readers-Web-Backlog board.
pmiazga updated the task description. (Show Details)Jun 4 2019, 4:36 PM
ovasileva set the point value for this task to 5.Jun 4 2019, 4:42 PM
pmiazga added a subscriber: pmiazga.Jun 4 2019, 4:44 PM
This comment was removed by pmiazga.
pmiazga updated the task description. (Show Details)Jun 4 2019, 4:47 PM
Ammarpad updated the task description. (Show Details)Jun 5 2019, 11:05 AM
Ammarpad updated the task description. (Show Details)
Ammarpad claimed this task.Dec 1 2019, 7:01 AM
Viewing invalid diff on mobile

Eg: https://m.mediawiki.org/wiki/Special:MobileDiff/invalid

currentproposed

Change 553837 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/extensions/MobileFrontend@master] Show a nice error message for invalid revisions

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

This comment was removed by Masumrezarock100.
Niedzielski reassigned this task from Ammarpad to Edtadros.Dec 2 2019, 3:18 PM
Niedzielski updated the task description. (Show Details)

@ovasileva, I've merged @Ammarpad's nice patch. It looked low risk, was a solid improvement, and the patch was ready and waiting. As the patch is now merged, I'm moving this into the kanban board for testing by @Edtadros.

Change 553837 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Show a nice error message for invalid revisions

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

QA

  1. Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Special:MobileDiff/898964501898964501
  2. This should show a friendly error message in the Minerva skin. It should not show a blank white page with the text "The ID for the revision you requested does not exist."

message appears as expected, moving to signoff

ovasileva updated the task description. (Show Details)Dec 9 2019, 10:59 AM
ovasileva closed this task as Resolved.Dec 9 2019, 6:43 PM