New issue
Advanced search Search tips

Issue 703206 link

Starred by 0 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug-Regression

Blocked on:
issue 703707



Sign in to add a comment

Error page displayed when loading Reading list entries in offline

Project Member Reported by srikanthg@chromium.org, Mar 20 2017

Issue description

App Version: 59.0.3047.0 canary
iOS Version: 10.3, 9.3.5
Device: iPhone7, iPhone6 plus
URL: any

Steps to reproduce:
  1. Launch Google Chrome Canary
  2. Open any webpage
  3. Tap Menu → Share → Read later
  4. Wait for the document to be available for offline view
  5. After few seconds., Turn ON Airplane mode on device
  6. Open a new tab, open the above saved article from Reading List

Observed results: Error page displayed "There is no Internet connection"

Expected results: Offline view of the webpage should be opened.

Good Version: 59.0.3044.0 #8ccd62d
Bad Version: 59.0.3045 #8e63e7d

Number of times you were able to reproduce: 5/5
Bug reproducible after clean install: Yes
Bug reproducible after clearing cache and cookies: Yes
Bug reproducible on Chrome Mobile on Android: NA
Bug reproducible on Safari/Firefox: Firefox: NA, Safari: NA
Bug reproducible on current stable build (App Version, iOS Version): M57 NO
Bug reproducible on the current beta channel build (App Version, iOS Version): M58 NO

Link to video/image: https://drive.google.com/file/d/0B-xmXLQhjeKuQnJMNXhhUUhrVzg/view 
 
Cc: -olivierrobin@chromium.org
Labels: ReleaseBlock-Stable M-59
Owner: olivierrobin@chromium.org
Status: Started (was: Untriaged)
Cc: eugene...@chromium.org
This is caused by https://codereview.chromium.org/2756753002

Eugene, is there something I need to change to load with the new navigation code?
Cc: mard...@chromium.org
I reverted CL/2756753002 and still can reproduce the issue. From my understanding this CL does not change the behavior, but only removes dead code. Olivier, are you sure that CL/2756753002 is a culprit?
Cc: kkhorimoto@chromium.org
Could it be related to crbug.com/702431?
Issue 702431 was only related to preload Tabs, and it doesn't look like this is the case given the repro steps in comment #1.
Cc: liaoyuke@chromium.org
More likely caused by https://codereview.chromium.org/2741413007
Olivier, is it possible to add an EG test to prevent this type of regressions?
There is a CL in flight that both fix the problem and adds EG tests.
I am polishing it an I will send it to review tonight (French time).
If cl/2741413007 introduced a bug then maybe instead of putting a workaround into chrome layer we should fix the bug in ios/web? Yuke, can you fix newly written reload code, so it does not break reading list?
Sure, I'll look into it ASAP
To be more specific on what changed, it is the fact that |navigationManager reload| now calls |webController reload|, which in turn call |nativeContent reload|.
- So when displaying the offline page, there is an error page displayed. |webController reload| calls |ErrorPageContent reload| which erase the chrome://offline url
- When navigating from the offline page, calling |navigationManager reload| from |nativeContent reload| now leads to circular call.


Thanks Olivier. Kurt, do you think that current Reload behavior is WAI? Oliver already has a fix in chrome layer.
Blockedon: 703707
I'm not exactly sure when Reload() is called in the Reading List flow.  Just to clarify we're rewriting the current NavigationItem's URL (and virtual URL), then calling reload to load the offline version, right?  I know we have that logic where if the page is loading too slowly, we'll fall back to the offline version, but I'm unfamiliar with the flow for when we're displaying an error page.  I think ideally, we'd want to catch the offline error before ErrorPageContent is displayed, and display the offline Reading List version.

In any case, I think CRWWebController's |-reload| should be updated to handle error pages; I'm going to update the implementation now (see blocking bug).  This should help with the scenario being described here, but I still think that it'd be better behavior to use a native Reading List view instead of showing an ErrorPageContents before reloading.

For clarification on the current behavior:
- We trigger the offline page either if the loading is too long, or of the page loading failed (WebStateObserver::Pageloaded(FAILURE) is called).
At that point, the error page is already created.

If we can branch our failure detection earlier, I have no objection at all.
I see.  Is there a brief flash of the error page before displaying the offline mode?  Or does it all occur within the same runloop, so there are no animation glitches when displaying the offline version?  I created a CL that will fix the reload behavior to use the NavigationItem's URL rather than the native content, which should restore old behavior: https://codereview.chromium.org/2765903003/


IIUC, it is in the same runloop.

I commented on your CL. I think we need an extra test in it.
Unfortunately your comment on the CL won't help because it'd still go through to the ErrorPageContent's |-reload|.  It's probably best to use your chrome-layer workaround in addition to my fix.
You are right.
I have no objection in committing your fix and my workaround.

Another possible solution would be to make |CRWNativeContent reload| return a BOOL saying if it handled the reload.
As ErrorPageContent has no reason to handle it, it should just return NO and WebController would handle the reload.


We going to get rid of NativeContent eventually, so maybe we should not put too much efforts into this.
Another option might be adding a condition to |CRWWebController reload| so that we can reset the native controller to OfflinePageNativeController, but we don't really want the web layer to know anything about Reading List.
ErrorPageContent is actually behaving correctly on Reload().  Reloading the error page should attempt to reload the URL that caused the error.  Since the ErrorPageContent is created with the online URL before we get a chance to rewrite the current NavigationItem's URL to the offline version, reloading the page will attempt reloading the online URL, which will create a new ErrorPageContent.

A more robust solution would be a version of what Yuke is suggesting.  We could cache the last URL that was loaded, and in CRWWebController's |-reload|, we can ask for a new native controller rather than reloading the current one if the current native URL is different than the one that vended the ErrorPageContent.

That being said, I think Eugene has a point about not worrying too much about the native content API since we're trying to get rid of it.  Your GoToItem(GetCurrentNavigationIndex()) hack will work fine to fix this scenario.
Labels: -ReleaseBlock-Stable ReleaseBlock-Beta
Status: Fixed (was: Started)
Status: Verified (was: Fixed)
Reading list offline page is opened correctly in offline.
Verified on M59.0.3062.0 dev
Device: iPhone7, iPad pro
iOS: 10.3, 10.1.1

Sign in to add a comment