[Settings][Application Storage] App Storage does not show accurate storage left

RESOLVED FIXED in 2.1 S9 (21Nov)


Firefox OS
3 years ago
3 years ago


(Reporter: Jeremiah Lee, Assigned: gasolin)


(Depends on: 1 bug)

2.1 S9 (21Nov)
Gonk (Firefox OS)

Firefox Tracking Flags

(b2g-v2.0 affected, b2g-v2.1 affected, b2g-v2.2 affected)


(Whiteboard: [2.1-exploratory-3][p=1], URL)


(2 attachments)

8.52 KB, text/plain
46 bytes, text/x-github-pull-request
: review+
iliu@mozilla.com, ianliu.moz@gmail.com
: feedback+
Details | Review | Splinter Review


3 years ago
Created attachment 8516908 [details]

Storage left amount doesn't appear to change if under 50 MB. If around 30 MB are installed on device, App Storage will still show 2 GB left.
Repro Steps:
1) Update a Flame device to BuildID: 20141104001202
2) On Homescreen, go to Settings > Application Storage
3) Take note of storage used and left
4) Search for ":packaged" in Marketplace to find packaged apps
5) Install any app over 1 MB (install around 10 apps)
6) On Homescreen, go to Settings > Application Storage
7) Notice "Left" is still 2 GB with storage space used (with 37 MB installed)
When around 37 MB of apps are installed on device the Used will show 37 MB and the Left will show 2 GB. There is less than 2 GB of storage left on device.

-After downloading/installing 37 MBs of apps.
	Total space - 2 GB
	Used - 37 MB
	Left - 2 GB
There is not 2 GB storage left on device.

-After downloading more apps:
	Total space - 2 GB
	Used - 78.1 MB
	Left - 1.9 GB
Accurate, but "1.99" is more clear.
"Left" will show more accurate storage left. If there is not 2 GB of storage left, "Left" will not show 2 GB. Storage left is more clear.
Environmental Variables:
Device: Flame 2.1 (319mb)(KitKat)(Shallow Flash)
BuildID: 20141104001202
Gaia: 8b0cf889ae0d48a9eb7ecdcb9b67590de45cc5e5
Gecko: 388b03efe92d
Version: 34.0 (2.1)
Firmware: V188-1
User Agent: Mozilla/5.0 (Mobile; rv:34.0) Gecko/34.0 Firefox/34.0
Repro frequency: 100%
See attached: video clip (http://youtu.be/P01A5jugzdM?t=3m7s), logcat (AppStoragelogcat.txt)

Comment 1

3 years ago
Issue is also seen in 2.0 and 2.2.

When around 37 MB of apps are installed on device the Used will show 37 MB and the Left will show 2 GB. There is less than 2 GB of storage left on device.

Device: Flame 2.2(319mb)(KitKat)(Shallow Flash)
Build ID: 20141104040207
Gaia: 3c50520982560ccba301474d1ac43706138fc851
Gecko: 54d05732f29b
Version: 36.0a1 (2.2)
Firmware Version: v188-1
User Agent: Mozilla/5.0 (Mobile; rv:36.0) Gecko/36.0 Firefox/36.0

Device: Flame 2.0(319mb)(KitKat)(Shallow Flash)
BuildID: 20141104000201
Gaia: fe2167fa5314c7e71c143a590914cbf3771905a8
Gecko: 241e51806687
Version: 32.0 (2.0)
Firmware: V188-1
User Agent: Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(dharris)
This seems like it might be intended. NI settings owner to see what is expected here.
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(dharris) → needinfo?(gchang)
Hi Alphan,
I'm not sure if this is intended design, can you help to answer this?
Flags: needinfo?(gchang) → needinfo?(alchen)
As I know, API return the result in bytes.
So gaia could get accurate size from gecko.
This result maybe related to UX design.

Hi Ian,
could you have your comment about this case?

The following function should be the key part of this result.
js/utils.js:201:  function showFormatedSize(element, l10nId, size)
Flags: needinfo?(alchen) → needinfo?(iliu)
AFAIK, API is able to return the result in bytes. Agree with Alphan's comment, the result might be related to specific design. Otherwise, it should be a bug for me.

Since Fred has refactored the code base of app storage before, I think he is more familiar the behaviour and expected result than me.

Fred, is the result expected for UX design? Thanks.
Flags: needinfo?(iliu) → needinfo?(flin)

Comment 6

3 years ago
The result could be related to UX design.

Since from code view, in settings Storage panels we show 1 float digit if file size is larger than 1MB, in system bluetooth manager, we show 2 float digits instead. It's ok for gaia if UX want to show same result everywhere.

ni @jenny for UX decision.
Flags: needinfo?(flin) → needinfo?(jelee)

Comment 7

3 years ago
Hi Fred,

Let's show 2 float digits when needed, if 2 digits still can't reflect the accurate state, I think it's ok to ignore the minor difference. Thanks!
Flags: needinfo?(jelee)

Comment 8

3 years ago
Created attachment 8517943 [details] [review]
pull request redirect to github

According to jenny's comment 

I take same method to show 2 digits storage size from system/js/bluetooth_transfer https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/bluetooth_transfer.js#L95
Attachment #8517943 - Flags: review?(arthur.chen)
Attachment #8517943 - Flags: feedback?(iliu)


3 years ago
Assignee: nobody → gasolin
Whiteboard: [2.1-exploratory-3] → [2.1-exploratory-3][p=1]
Target Milestone: --- → 2.1 S8 (7Nov)
Comment on attachment 8517943 [details] [review]
pull request redirect to github

The modification of function `getReadableFileSize()` is okay for me. That will support 2 digital storage size well.

But, we should be careful to replace `showFormatedSize()` with `getReadableFileSize()`. In fact, app_storage/panel.js, storage_app_item.js, storage_usb_item.js, media_storage.js are using `showFormatedSize()`.
Attachment #8517943 - Flags: feedback?(iliu) → feedback+
Comment on attachment 8517943 [details] [review]
pull request redirect to github

r=me, thanks!
Attachment #8517943 - Flags: review?(arthur.chen) → review+

Comment 11

3 years ago
merged https://github.com/mozilla-b2g/gaia/commit/399b2bf0868630aa668604d84125be65e00f2d51

Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: 2.1 S8 (7Nov) → 2.1 S9 (21Nov)


3 years ago
Depends on: 1109327

Comment 12

3 years ago
This issue still occurs on the 2.2

App storage is inaccurate from the what was loaded onto the memory 

Environmental Variables:
Device: Flame 2.2 (319mb) (Kitkat Base)(Full Flash)
Build ID: 20141208040202
Gaia: 0e429d970c160e580e19e61ad8ff5612de159f00
Gecko: c4c7442e9113
Gonk: 48835395daa6a49b281db62c50805bd6ca24077e
Version: 37.0a1 (2.2)
Firmware Version: v188-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

A new bug 1109327 was written for this.
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage?]
Flags: needinfo?(ktucker)


3 years ago
QA Whiteboard: [QAnalyst-Triage?] → [failed-verification][QAnalyst-Triage?]
QA Whiteboard: [failed-verification][QAnalyst-Triage?] → [failed-verification][QAnalyst-Triage+]
Flags: needinfo?(ktucker)
You need to log in before you can comment on or make changes to this bug.