Page MenuHomePhabricator

Link preview offline error message is shown for missing pages that return a 404 HTTP status
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproduce

  1. Change the app language to Bislama (BI)
  2. Go to the matematikis page
  3. Tap the Lojik link in the second paragraph

Expected results

Link preview prompts the user to create the page
Link preview advises user that this page does not exist (since it is not currently possible to create a page within the Android app)

Actual results

Link preview says the device is offline

screenshot-2017-03-21-10-48-22-744198429.png (800×480 px, 38 KB)

Environments observed

App version: 49d4bb7
Android OS versions: API 25
Device model: AOSP Nexus S emulator
Device language: English

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
ResolvedJdlrobson
Resolved Mholloway
ResolvedNone
ResolvedArlolra
ResolvedEsanders
ResolvedCatrope
DeclinedNone
DeclinedNone
Resolvedssastry
Resolved bearND
Resolved bearND
Resolved bearND
Resolved bearND
OpenNone
Resolved Jhernandez
OpenNone
Resolved marcoil
ResolvedCatrope
Resolved marcoil
ResolvedArlolra
ResolvedArlolra
Resolved GWicke
Resolved GWicke
Resolved GWicke
Resolvedfgiunchedi
Resolvedfgiunchedi
Resolved Cmjohnson
Resolved Cmjohnson
ResolvedJoe
Resolvedfgiunchedi
Resolved GWicke
Resolved Jdouglas
Resolved GWicke
Resolved GWicke
ResolvedArlolra
Resolved GWicke
Resolved mobrovac
Resolved mobrovac
Resolved mobrovac
Resolved mobrovac
Duplicate Jdouglas
ResolvedAndrew
Resolved GWicke
Resolvedfgiunchedi
Resolvedfgiunchedi
Resolvedfgiunchedi
ResolvedEevans
Resolvedfgiunchedi
Resolved GWicke
Resolved GWicke
Resolvedfgiunchedi
Resolved mobrovac
Resolved GWicke
Resolved GWicke
Resolved AlexMonk-WMF
Resolved santhosh
Resolvedssastry
Resolved Mholloway
ResolvedJackmcbarn
ResolvedRenxiaoyi
Resolvedcscott
ResolvedKelson
OpenNone
OpenNone
OpenNone
ResolvedArlolra
ResolvedArlolra
OpenNone
DeclinedNone
OpenNone
OpenNone
DeclinedNone
DeclinedNone
DeclinedNone
OpenNone
OpenNone
InvalidNone
InvalidNone
DuplicateNone
DuplicateNone
Resolved Jhernandez
ResolvedJdlrobson
DuplicatePeter
Resolved bmansurov
DeclinedNone
DuplicateNone
Resolved nray
Resolvedphuedx
ResolvedAnomie
ResolvedAnomie
ResolvedAnomie
ResolvedEBernhardson
ResolvedAnomie
ResolvedAnomie
OpenNone
DuplicateNone
ResolvedNone
Resolvedphuedx
DeclinedNone
Resolved Pchelolo
ResolvedArlolra
Resolved Mholloway
OpenFeatureNone

Event Timeline

@RHo/@Dbrant, I should have asked yesterday during grooming and triage, but does this need design? Will a generic exclamation point icon and an appropriate message suffice?

Looking at this in more detail (/with more attention) it seems the root cause is that this is a dead link but not being shown as a red link, as is already captured on task T119266.

Per that ticket, suggest the following preference for resolution:
1. Red links for dead links – It's been a while since T119266 so not sure if the RestBase issue has been resolved but this seems ideal, so that users have a greater visual hint that the page does not exist (per existing style on web). If the user taps on that red link, a link preview appears with a message advising 'This page does not exist' after the exclamation error icon.
2. Hide dead links – this was the interim solution proposed in T119266.
3. Just show the message from preference 1 without the dead link shown in red.

T119266 remains unresolved. Yesterday I updated an old content service patch I'd made to address it. The older version(s) of the patch (last updated a little over a year ago) caused problems when deployed to production, and so had to be reverted, but I'm hopeful that the new version will fare better if merged.

The new patch just marks links to missing pages rather than actually stripping them out of the HTML served to the app, as the old one did. This approach matches what happens in HTML served by the MediaWiki API and allows clients to choose how to deal with the missing links, so we could either show them in red, or continue removing them on the client side as we currently do with mobileview HTML.

Actually, T119266 is a downstream issue and my MCS patch is really just a workaround. T39902: RFC: Implement rendering of redlinks in Parsoid HTML as post-processor is the fundamental task that needs resolving for this.

If we update to show red links, we should do it for both HTML sources. @Dbrant, what's your opinion on this? Cross-platform consistency is appealing, but on the other hand, the point of red links is to invite users to create the pages linked, and if the app doesn't provide that capability, then there's little point in giving the user a link to click on at all.

Agreed that the app should not show red links at all, since it doesn't lead to any actionable experience.

Change 344687 had a related patch set uploaded (by Mholloway):
[apps/android/wikipedia@master] Show an accurate message in the link preview when a page doesn't exist

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

Do we want to disable navigating to the article from the link preview when offline?

Yes, since this would just link to an error does not exist page anyway.

Yes, since this would just link to an error does not exist page anyway.

Does this hold when the user's truly offline (and would get an accurate offline message from the link preview and page error views) as well?

Change 344687 merged by jenkins-bot:
[apps/android/wikipedia@master] Show an accurate message in the link preview when a page doesn't exist

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

Change 346781 had a related patch set uploaded (by Mholloway):
[apps/android/wikipedia@master] Prevent navigating to page from link previews w/ errors (except offline)

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

Change 346781 merged by jenkins-bot:
[apps/android/wikipedia@master] Prevent navigating to page from link previews w/ errors (except offline)

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

Hi @Mholloway – just want to clarify that expected when a user encounters a non-existent page link in an article (ie., what shows up as a red link on Web):

A. User is online and taps on a link to a non-existent page

EXPECTED:
Link preview card/Page opens with a error icon and a message that 'This page does not exist'.
ACTUAL:
Only a generic 'An error occurred' message is shown.

main-MainActivity-04172017181544.png (1×1 px, 171 KB)
main-MainActivity-04172017181720.png (1×1 px, 79 KB)
B. User is offline and taps on a link to a non-existent page

At the moment since there is no way to hide links to non-existent page...
EXPECTED
The standard 'article cannot be loaded' message will appear, and allows the user to save the non-existent page to a reading list.
ACTUAL
As expected.

main-MainActivity-04172017181658.png (1×1 px, 341 KB)
main-MainActivity-04172017181645.png (1×1 px, 173 KB)
TESTED ON

Device = Nexus 5 (Android 6.0.1)
Version = 2.5.192-alpha-2017-04-12)

Change 348866 had a related patch set uploaded (by Mholloway):
[apps/android/wikipedia@master] Fix: Update error handling to handle new cache responses

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

Change 348866 merged by jenkins-bot:
[apps/android/wikipedia@master] Fix: Update error handling to handle new cache responses

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

ABorbaWMF subscribed.

Tested on Nexus 4 Android 5.1 and Pixel Android 7.1.1 both running 2.5.195-alpha-2017-04-24

Appears to be fixed. Tested online and offline.