downloadavailable flag is removed if you reboot after stopping the download

VERIFIED FIXED in Firefox 21

Status

Core Graveyard
DOM: Apps
VERIFIED FIXED
6 years ago
9 months ago

People

(Reporter: julienw, Assigned: fabrice)

Tracking

Trunk
mozilla21
ARM
Gonk (Firefox OS)

Firefox Tracking Flags

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

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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 ?
(Assignee)

Comment 1

6 years ago
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.

Updated

6 years ago
Blocks: 777048, 728081
(Assignee)

Comment 8

6 years ago
Created attachment 701092 [details] [diff] [review]
patch

We were resetting the downloadAvailable flag in cancelDownload, which is quite wrong.
(Assignee)

Comment 9

6 years ago
Julien confirmed in real life that this works.
(Reporter)

Comment 10

6 years ago
Comment on attachment 701092 [details] [diff] [review]
patch

verified that this fixes the bug for me

thanks !
(Assignee)

Updated

6 years ago
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+
(Assignee)

Comment 12

6 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Keywords: verifyme
status-b2g18: --- → fixed
status-firefox19: --- → wontfix
status-firefox20: --- → wontfix
status-firefox21: --- → fixed
Target Milestone: --- → mozilla21

Updated

6 years ago
No longer blocks: 777048
Verified with a packaged app on 1/24 build.
Status: RESOLVED → VERIFIED
Keywords: verifyme

Updated

9 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.