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

Issue 639911 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: ----

Blocking:
issue 616324



Sign in to add a comment

Downloads space calculation doesn't account for duplicate entries or externally removed files

Project Member Reported by twelling...@chromium.org, Aug 22 2016

Issue description

The space calculation in the Downloads UI doesn't currently account for
1. Duplicate entries e.g. I downloaded the same file 3 times, overwriting each time. Currently the file's size will be triple counted in the space calculation
2. Externally removed files e.g. removed file through Downloads app. We already check for this and alter the display. We should not include the size of externally removed files in the space calculation.
 
Blocking: 616324
Theresa: is this a problem anymore?  I think we stopped showing dupes at some point.
We still show duplicates; you can no longer create dupes but that doesn't do anything for existing dupes.
Labels: -Restrict-View-Google -Pri-1 -M-54 M-57 Pri-2
Status: Started (was: Assigned)
Cc: dfalcant...@chromium.org
Owner: dtrainor@chromium.org
Status: Untriaged (was: Started)
Cc: qin...@chromium.org
Labels: -M-57 M-60
Owner: xingliu@chromium.org
Status: Assigned (was: Untriaged)
I will fix the size by checking the file paths, but should we just show dupes? 

History items are to record all user download actions. I think it's legit to have dupes?
By show duplicates, do you mean display them in the UI? If so, we do show duplicates. We should only count each unique filepath in the space display once in the space display, however.

Before the download info bar was redone, it was possible to overwrite a file. For example, user downloads an image called image.png. A few days later, user downloads a different image called image.png overwriting the original. The downloads back end will provide two download history entries, but only the most recent entry is actually taking up disk space since the first was overwritten. We currently count the file size twice, once for each entry.
Thanks, makes sense.
Project Member

Comment 12 by bugdroid1@chromium.org, May 5 2017

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

commit 26f8a66eafef66b5c9c64d40028a0769291eb0e5
Author: xingliu <xingliu@chromium.org>
Date: Fri May 05 22:37:01 2017

Fix duplicate space calculation on Android download home.

Check duplicate file paths when calculate disk space shown in UI.

Current Android code doesn't generate duplicate path, but we still need
this fix for existing records.

I think we shouldn't filter duplicate entries however, since the download
history is not the same concept as a list of files on disk.

BUG= 639911 

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

[modify] https://crrev.com/26f8a66eafef66b5c9c64d40028a0769291eb0e5/chrome/android/java/src/org/chromium/chrome/browser/download/ui/BackendItems.java
[modify] https://crrev.com/26f8a66eafef66b5c9c64d40028a0769291eb0e5/chrome/android/javatests/src/org/chromium/chrome/browser/download/DownloadActivityTest.java

Status: Fixed (was: Assigned)

Sign in to add a comment