Page MenuHomePhabricator

Link preview offline error message is shown for missing pages that return a 404 HTTP status
Closed, ResolvedPublic1 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

Environments observed

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

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

Restricted Application added a subscriber: Aklapper. Ā· View Herald TranscriptMar 21 2017, 4:51 PM

@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?

RHo updated the task description. (Show Details)Mar 23 2017, 4:23 PM
RHo added a comment.Mar 23 2017, 4:34 PM

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?

RHo added a comment.Mar 27 2017, 7:45 PM

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

RHo added a comment.Apr 17 2017, 4:21 PM

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.

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.

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 added a subscriber: ABorbaWMF.

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.

Dbrant closed this task as Resolved.May 1 2017, 3:25 PM