New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 618716 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug

Blocking:
issue 642277



Sign in to add a comment

Handling original and redirect links to offline pages

Project Member Reported by dougarnett@chromium.org, Jun 9 2016

Issue description

The OfflinePageModelImpl ensures that the URL associated with an offline page is the same as the last committed URL from the WebContents. 

How should we handle redirected links? Do we want to be able to call up the redirected saved page for the original link (for effective offline caching)?

I encountered this issue when triggering an async load request off search page results for wikipedia that redirects to a *.m.* link. When offline I can't open the offline page from the SRP because the original link is not associated with it (it seems I need to be online to get the redirect to resolve it).

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e759fe98d6b70f487d5f5474b00703d1ba492d53

commit e759fe98d6b70f487d5f5474b00703d1ba492d53
Author: dougarnett <dougarnett@chromium.org>
Date: Thu Jun 09 20:45:16 2016

For Offliner, pass in the URL from WebContents to SavePage request instead of the request URL since redirect link will fail a URL check in OfflinePageModelImpl.
This is workaround until better understand how to deal with redirected URLs for async loading.

BUG= 618716 

Review-Url: https://codereview.chromium.org/2052913002
Cr-Commit-Position: refs/heads/master@{#399001}

[modify] https://crrev.com/e759fe98d6b70f487d5f5474b00703d1ba492d53/chrome/browser/android/offline_pages/prerendering_offliner.cc

Cc: talo@chromium.org
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e759fe98d6b70f487d5f5474b00703d1ba492d53

commit e759fe98d6b70f487d5f5474b00703d1ba492d53
Author: dougarnett <dougarnett@chromium.org>
Date: Thu Jun 09 20:45:16 2016

For Offliner, pass in the URL from WebContents to SavePage request instead of the request URL since redirect link will fail a URL check in OfflinePageModelImpl.
This is workaround until better understand how to deal with redirected URLs for async loading.

BUG= 618716 

Review-Url: https://codereview.chromium.org/2052913002
Cr-Commit-Position: refs/heads/master@{#399001}

[modify] https://crrev.com/e759fe98d6b70f487d5f5474b00703d1ba492d53/chrome/browser/android/offline_pages/prerendering_offliner.cc

Cc: jianli@chromium.org
Status: Assigned (was: Untriaged)
Discuss this with jianli@

Comment 5 by dim...@chromium.org, Jun 29 2016

Labels: -Pri-2 Pri-3
Indeed, for now GetLastCommittedURL() is the right way to handle that, at least consistent across features. Keeping this bug open for design tracking purposes.
Blocking: 642277
Cc: pke@google.com dim...@chromium.org petewil@chromium.org dewittj@chromium.org
[pke@ opened dupe 642277 on this issue wrt Zine experimenting with context menu option. I'm not sure how we deal with dupes in chromium so marked as blocking for now.]

Dmitry, was your proposal that we will still only store one URL for the page but make it an option as to which endpoint URL to store with it? With per namespace config being one option?
 Issue 642277  has been merged into this issue.
Owner: dougarnett@chromium.org
The way we handle it for now is we store final, redirected url in the OfflinePageModel, and original URL in client_id.id for the namespaces that are concerned with the original URL (CCT API). While a bit asymmetrical, this seems to work ok for now. 

Having said that, I wonder if the bug we just resolved as dupe is actually that issue. It looks to me that we are snapshotting the page that is a redirect request. I played with results of Google Search and sometimes I get the final redirected page but often the redirect page itself (empty body, the reload actually redirects to the target).

Here are my steps:
1. open www.google.com
2. search for term "search"
3. Long-press, "save later" on entry for Bing - observe actual Bing page to be loaded
4. Long-press, "save later" on other entries - observe the redirect page to be saved.


Oh yes, this does look like different behavior than I originally saw for this bug. Will undupe pke's bug. 
Owner: ----
Status: Available (was: Assigned)
Owner: jianli@chromium.org
Status: Assigned (was: Available)
Jianli@: please work with fgorski on actual change, this is part of Async Load.
Cc: vitaliii@chromium.org
Labels: -Pri-3 Pri-1
This is p1 now, since we want to launch async right?
Cc: nepper@chromium.org
This happened to block NTP. Sorry for the late notice.
For non offline page related sections (e.g. bookmarks or articles for you) we cannot enforce offline version for redirecting URL, because we have only initial URL and you AFAIK have final URL.
Labels: zine-downloads-v1 M-56 zine-triaged
Thanks for increasing priority!
Labels: -zine-downloads-v1 zine-client-v1
Project Member

Comment 20 by bugdroid1@chromium.org, Nov 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/093a2a9dd37c96fb55776c5415c8dd768328e4c2

commit 093a2a9dd37c96fb55776c5415c8dd768328e4c2
Author: jianli <jianli@chromium.org>
Date: Wed Nov 16 21:30:25 2016

Store original request URL in offline page metadata table

This will be used to support triggering redirect from original request
URL to last committed URL which is used to identify the offline page.

BUG= 618716 
TBR=bauerb@chromium.org

Review-Url: https://codereview.chromium.org/2484223005
Cr-Commit-Position: refs/heads/master@{#432632}

[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/android/offline_pages/offline_page_bridge.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/android/offline_pages/offline_page_request_job_unittest.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/android/offline_pages/prerendering_offliner.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/android/offline_pages/prerendering_offliner.h
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/android/offline_pages/prerendering_offliner_unittest.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/android/offline_pages/recent_tab_helper.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/chrome/browser/ui/webui/offline/offline_internals_ui_message_handler.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_item.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_item.h
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_metadata_store_impl_unittest.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_metadata_store_sql.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_metadata_store_sql.h
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_model.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_model.h
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_model_impl.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_model_impl.h
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/offline_page_model_impl_unittest.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/stub_offline_page_model.cc
[modify] https://crrev.com/093a2a9dd37c96fb55776c5415c8dd768328e4c2/components/offline_pages/stub_offline_page_model.h

Project Member

Comment 21 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/610b1fdb73c904e2629f8730b55909c06fd85cf7

commit 610b1fdb73c904e2629f8730b55909c06fd85cf7
Author: jianli <jianli@chromium.org>
Date: Thu Nov 17 23:17:52 2016

Support getting offline pages also by original URL

BUG= 618716 

Review-Url: https://codereview.chromium.org/2503853004
Cr-Commit-Position: refs/heads/master@{#433013}

[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/chrome/browser/android/offline_pages/offline_page_bridge.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/chrome/browser/android/offline_pages/offline_page_request_job.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/chrome/browser/android/offline_pages/offline_page_request_job.h
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/chrome/browser/android/offline_pages/offline_page_tab_helper.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/chrome/browser/android/offline_pages/offline_page_tab_helper.h
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/chrome/browser/android/offline_pages/offline_page_utils.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/chrome/browser/android/offline_pages/offline_page_utils.h
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/components/offline_pages/offline_page_metadata_store_impl_unittest.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/components/offline_pages/offline_page_model.h
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/components/offline_pages/offline_page_model_impl.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/components/offline_pages/offline_page_model_impl.h
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/components/offline_pages/offline_page_model_impl_unittest.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/components/offline_pages/stub_offline_page_model.cc
[modify] https://crrev.com/610b1fdb73c904e2629f8730b55909c06fd85cf7/components/offline_pages/stub_offline_page_model.h

Project Member

Comment 22 by bugdroid1@chromium.org, Nov 18 2016

Comment 23 by fi...@chromium.org, Nov 21 2016

This change landed after BP. I guess we have to merge it back to M56, right?
Before BP Offline Pages team ensured me that they would merge this. 
Thus, what is the expected timeline? 
Without this merge, NTP is in a fairly broken state, when offline badges are shown, but, when clicked, *online* version is opened.
Cc: ntp-dev+bugs@chromium.org
 Issue 666208  has been merged into this issue.
I think jianli@ already landed most of the patches on trunk and he should start merging it today, unless he is OOF.

Based on his code reviews, there is one outstanding patch that need landing on trunk, related to capturing UMA for the redirection. https://codereview.chromium.org/user/jianli
Labels: Merge-Request-56
The last patch 433318 needs to be merged to M56.

Comment 28 by dimu@chromium.org, Nov 22 2016

Labels: -Merge-Request-56 Merge-Approved-56 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M56 (branch: 2924)
Project Member

Comment 29 by bugdroid1@chromium.org, Nov 22 2016

Labels: -merge-approved-56 merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1210efb30b84501b546b16a45a3a8c544ebd7f3e

commit 1210efb30b84501b546b16a45a3a8c544ebd7f3e
Author: Jian Li <jianli@chromium.org>
Date: Tue Nov 22 01:05:16 2016

Merge to M56: Trigger redirect for offline pages

If original request URL is found, we will use it to trigger redirect
such that offline page for final redirected URL could be served.

BUG= 618716 

Review-Url: https://codereview.chromium.org/2506293002
Cr-Commit-Position: refs/heads/master@{#433318}
(cherry picked from commit 55994375eb39e2965999474fb3612737626bed13)

Review URL: https://codereview.chromium.org/2523603002 .

Cr-Commit-Position: refs/branch-heads/2924@{#48}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/1210efb30b84501b546b16a45a3a8c544ebd7f3e/chrome/browser/android/offline_pages/offline_page_request_job.cc
[modify] https://crrev.com/1210efb30b84501b546b16a45a3a8c544ebd7f3e/chrome/browser/android/offline_pages/offline_page_request_job.h
[modify] https://crrev.com/1210efb30b84501b546b16a45a3a8c544ebd7f3e/chrome/browser/android/offline_pages/offline_page_request_job_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment