Closed Bug 828944 Opened 11 years ago Closed 11 years ago

downloadavailable flag is removed if you reboot after stopping the download

Categories

(Core Graveyard :: DOM: Apps, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-basecamp:+, firefox19 wontfix, firefox20 wontfix, firefox21 fixed, b2g18 fixed)

VERIFIED FIXED
mozilla21
blocking-basecamp +
Tracking Status
firefox19 --- wontfix
firefox20 --- wontfix
firefox21 --- fixed
b2g18 --- fixed

People

(Reporter: julienw, Assigned: fabrice)

References

Details

Attachments

(1 file)

STR:
* install a packaged app whose you can control the update
* change its manifest
* check for update from Settings > Device Information
* get the notification
* trigger the update
* cancel the download
* reboot the phone then wait for the timeout
=> the notification is not there anymore for this app
* press check for update
=> we don't get the notification for this app either

didn't try with anything other than a packaged app, could QA try this with an hosted+appcache app ?
Did you check what's in /data/local/webapps/webapps.json for this app?
bb+ since app updates need to work, but would love more info from QA.
blocking-basecamp: ? → +
(In reply to Lucas Adamski from comment #2)
> bb+ since app updates need to work, but would love more info from QA.

I'm looking into it right now.
QA Contact: jsmith
Before the update happens w/o restart:

  "{75ca1244-e863-4ee8-9aff-b39acb19cd33}": {
    "name": "Test WebAPI Permissions",
    "csp": "",
    "installOrigin": "http://mozqa.com",
    "origin": "app://{75ca1244-e863-4ee8-9aff-b39acb19cd33}",
    "receipts": [],
    "installTime": 1357824067150,
    "manifestURL": "http://mozqa.com/webapi-permissions-tests/simple_packaged_up
date/simple_packaged_update.manifest",
    "appStatus": 1,
    "removable": true,
    "id": "{75ca1244-e863-4ee8-9aff-b39acb19cd33}",
    "localId": 1025,
    "basePath": "/data/local/webapps",
    "progress": 17253,
    "installState": "installed",
    "downloadAvailable": true,
    "downloading": false,
    "readyToApplyDownload": false,
    "downloadSize": 10000,
    "lastUpdateCheck": 1357824067150,
    "etag": "\"2584d1-176-4d2eefae1e400\"",
    "packageEtag": "\"2584d2-4365-4d2ed3b406280\"",
    "installerAppId": 1002,
    "installerIsBrowser": true,
    "lastCheckedUpdate": 1357824105645
  }
Disregard comment 4. Screwed up my test...
Assignee: nobody → fabrice
Before update:

  "{12ef8091-1a96-4030-9928-0e761ffcdf5b}": {
    "name": "Test WebAPI Permissions",
    "csp": "",
    "installOrigin": "http://mozqa.com",
    "origin": "app://{12ef8091-1a96-4030-9928-0e761ffcdf5b}",
    "receipts": [],
    "installTime": 1357825762951,
    "manifestURL": "http://mozqa.com/webapi-permissions-tests/large_packaged_upd
ate/large_packaged_update.manifest",
    "appStatus": 1,
    "removable": true,
    "id": "{12ef8091-1a96-4030-9928-0e761ffcdf5b}",
    "localId": 1026,
    "basePath": "/data/local/webapps",
    "progress": 17253,
    "installState": "installed",
    "downloadAvailable": true,
    "downloading": false,
    "readyToApplyDownload": false,
    "downloadSize": 10000,
    "lastUpdateCheck": 1357825762951,
    "etag": "\"2584e3-175-4d2ef60451740\"",
    "packageEtag": "\"2584e4-4365-4d2ef56325b00\"",
    "installerAppId": 1002,
    "installerIsBrowser": true,
    "lastCheckedUpdate": 1357825825403
  }

After cancel download and restart phone:

  "{12ef8091-1a96-4030-9928-0e761ffcdf5b}": {
    "name": "Test WebAPI Permissions",
    "csp": "",
    "installOrigin": "http://mozqa.com",
    "origin": "app://{12ef8091-1a96-4030-9928-0e761ffcdf5b}",
    "receipts": [],
    "installTime": 1357825762951,
    "manifestURL": "http://mozqa.com/webapi-permissions-tests/large_packaged_upd
ate/large_packaged_update.manifest",
    "appStatus": 1,
    "removable": true,
    "id": "{12ef8091-1a96-4030-9928-0e761ffcdf5b}",
    "localId": 1026,
    "basePath": "/data/local/webapps",
    "progress": 0,
    "installState": "installed",
    "downloadAvailable": false,
    "downloading": false,
    "readyToApplyDownload": false,
    "downloadSize": 0,
    "lastUpdateCheck": 1357825762951,
    "etag": "\"2584e3-175-4d2ef60451740\"",
    "packageEtag": "\"2584e4-4365-4d2ef56325b00\"",
    "installerAppId": 1002,
    "installerIsBrowser": true,
    "lastCheckedUpdate": 1357825825403,
    "retryingDownload": false
  }

After doing a check for updates after a cancel download + restart phone:

  "{12ef8091-1a96-4030-9928-0e761ffcdf5b}": {
    "name": "Test WebAPI Permissions",
    "csp": "",
    "installOrigin": "http://mozqa.com",
    "origin": "app://{12ef8091-1a96-4030-9928-0e761ffcdf5b}",
    "receipts": [],
    "installTime": 1357825762951,
    "manifestURL": "http://mozqa.com/webapi-permissions-tests/large_packaged_upd
ate/large_packaged_update.manifest",
    "appStatus": 1,
    "removable": true,
    "id": "{12ef8091-1a96-4030-9928-0e761ffcdf5b}",
    "localId": 1026,
    "basePath": "/data/local/webapps",
    "progress": 0,
    "installState": "installed",
    "downloadAvailable": false,
    "downloading": false,
    "readyToApplyDownload": false,
    "downloadSize": 0,
    "lastUpdateCheck": 1357825762951,
    "etag": "\"2584e3-175-4d2ef60451740\"",
    "packageEtag": "\"2584e4-4365-4d2ef56325b00\"",
    "installerAppId": 1002,
    "installerIsBrowser": true,
    "lastCheckedUpdate": 1357826022662,
    "retryingDownload": false
  }
Keywords: qawanted
Oh and...yes I confirm the bug Julien has hit. Easy to reproduce too.
Attached patch patchSplinter Review
We were resetting the downloadAvailable flag in cancelDownload, which is quite wrong.
Julien confirmed in real life that this works.
Comment on attachment 701092 [details] [diff] [review]
patch

verified that this fixes the bug for me

thanks !
Attachment #701092 - Flags: review?(ferjmoreno)
Comment on attachment 701092 [details] [diff] [review]
patch

Review of attachment 701092 [details] [diff] [review]:
-----------------------------------------------------------------

r=me

::: dom/apps/src/Webapps.jsm
@@ +21,5 @@
>  Cu.import("resource://gre/modules/SystemMessagePermissionsChecker.jsm");
>  Cu.import("resource://gre/modules/AppDownloadManager.jsm");
>  
>  function debug(aMsg) {
> +  dump("-*-*- Webapps.jsm : " + aMsg + "\n");

Comment this line, please
Attachment #701092 - Flags: review?(ferjmoreno) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/87f5c5d262ca
https://hg.mozilla.org/releases/mozilla-b2g18/rev/b7102f307ea0

Marking fixed as per the new rules.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Keywords: verifyme
Target Milestone: --- → mozilla21
No longer blocks: market-packaged-apps
Verified with a packaged app on 1/24 build.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: