Created attachment 8516908 [details] AppStoragelogcat.txt Description: 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) Actual: 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. Expected: "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 Gonk: 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)
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
This seems like it might be intended. NI settings owner to see what is expected here.
Hi Alphan, I'm not sure if this is intended design, can you help to answer this?
As I know, API return the result in bytes. https://developer.mozilla.org/en-US/docs/Web/API/DeviceStorage.freeSpace 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)
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.
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.
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!
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
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()`.
Comment on attachment 8517943 [details] [review] pull request redirect to github r=me, thanks!
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.