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

Issue 655697 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 684916
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 705079



Sign in to add a comment

Offline Page Cache: do not delete previous save if last one fails

Project Member Reported by carlosk@chromium.org, Oct 13 2016

Issue description

Offline Page Caching may save an offline copy of a page twice in a page load. While running some tests I noticed that in the case where the 1st save operation was successful but the 2nd wasn't, the page would not have an offline version saved. I conclude that the 1st save is always deleted no matter the result of the 2nd.

It would be more useful to our users to only replace previous saves if the latest one is successful.
 

Comment 1 by dim...@chromium.org, Oct 13 2016

I think one way to implement it is to pass the same offline_id as returned by first save operation, and have the semantics of 'replace' when the same offline_id is used. This will help to alleviate some timing issues between offliners.

Comment 2 by dim...@chromium.org, Oct 13 2016

Labels: -Pri-3 M-56 Pri-2
BTW: the page that was presenting this in my tests was this TechCrunch article: https://techcrunch.com/2016/10/12/spray-and-pray/

Comment 4 by dim...@chromium.org, Oct 19 2016

Cc: carlosk@chromium.org
Owner: dim...@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 3 2016

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

commit 96de1925bdf5c051bb903581a427d7f9795c0032
Author: carlosk <carlosk@chromium.org>
Date: Sat Dec 03 00:01:25 2016

Failed offline snapshots won't erase a successful one from the same page load.

If a second offline snapshot starts for the same page load where a
previous one was saved, it should not immediately delete it: as it might
fail the user would end up with no offline copy of the page. This change
fixes this issue.

Three new tests are added: one to cover this precise case and a couple
more to check for related situations. Also many comments were added or
updated.

BUG= 655697 

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

[modify] https://crrev.com/96de1925bdf5c051bb903581a427d7f9795c0032/chrome/browser/android/offline_pages/recent_tab_helper.cc
[modify] https://crrev.com/96de1925bdf5c051bb903581a427d7f9795c0032/chrome/browser/android/offline_pages/recent_tab_helper.h
[modify] https://crrev.com/96de1925bdf5c051bb903581a427d7f9795c0032/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc
[modify] https://crrev.com/96de1925bdf5c051bb903581a427d7f9795c0032/components/offline_pages/offline_page_test_archiver.h

Owner: carlosk@chromium.org
The change in #5 fix the issue. There might be room for some simplification to recent_tab_helper.cc code that I will discuss with dimich@.
Status: Fixed (was: Assigned)
Cc: -carlosk@chromium.org
Status: Assigned (was: Fixed)
Reopening because this caused another problem ( issue 671955 ) so the patch from #5 is being reverted. More details in the upcoming revert patch notes.
Labels: -M-56 M-57
Project Member

Comment 10 by bugdroid1@chromium.org, Dec 13 2016

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

commit 3d768b7fc9d17d2df1f6d6d2d46758944e3bf09a
Author: carlosk <carlosk@chromium.org>
Date: Tue Dec 13 22:30:02 2016

Fix snapshots from Downloads being deleted by last_n.

Partially reverts the change that fixed good snapshots being deleted by
failed ones in the context of last_n
(https://codereview.chromium.org/2542833003/) because it created a new bug
were pages offline-d through Downloas were being incorrectly erased
( https://crbug.com/671955 ). The reverted fix will be solved again later using a
different approach.

The reason to make this revert only partial is to keep the test
improvements made which are still useful and valid. One test that had
to be disabled because of the fix being removed. A new test was also
added to confirm the incorrect snapshot deletion issue and avoid future
occurrences.

BUG= 655697 , 671955 

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

[modify] https://crrev.com/3d768b7fc9d17d2df1f6d6d2d46758944e3bf09a/chrome/browser/android/offline_pages/recent_tab_helper.cc
[modify] https://crrev.com/3d768b7fc9d17d2df1f6d6d2d46758944e3bf09a/chrome/browser/android/offline_pages/recent_tab_helper.h
[modify] https://crrev.com/3d768b7fc9d17d2df1f6d6d2d46758944e3bf09a/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc

Labels: -M-57
Mergedinto: 684916
Status: Duplicate (was: Assigned)
Marking as a duplicate of issue 684916 because it encompasses this one.
Blocking: 705079

Sign in to add a comment