diff --git a/src/apps.js b/src/apps.js index 7b9be83c4..396996578 100644 --- a/src/apps.js +++ b/src/apps.js @@ -680,8 +680,7 @@ function backupApp(app, addonsToBackup, callback) { function canBackupApp(app) { // only backup apps that are installed or pending configure. Rest of them are in some - // state not good for consistent backup - + // state not good for consistent backup (i.e addons may not have been setup completely) return (app.installationState === appdb.ISTATE_INSTALLED && app.health === appdb.HEALTH_HEALTHY) || app.installationState === appdb.ISTATE_PENDING_CONFIGURE || app.installationState === appdb.ISTATE_PENDING_BACKUP diff --git a/src/apptask.js b/src/apptask.js index 63f3664eb..78f78915c 100644 --- a/src/apptask.js +++ b/src/apptask.js @@ -755,8 +755,14 @@ function update(app, callback) { deleteImage.bind(null, app, app.manifest), // delete image even if did not change (see df158b111f) removeIcon.bind(null, app), - updateApp.bind(null, app, { installationProgress: '20, Backup app' }), - apps.backupApp.bind(null, app, app.oldConfig.manifest.addons), + function (next) { + if (app.installationState === appdb.ISTATE_PENDING_FORCE_UPDATE) return next(null); + + async.series([ + updateApp.bind(null, app, { installationProgress: '20, Backup app' }), + apps.backupApp.bind(null, app, app.oldConfig.manifest.addons) + ], next); + }, updateApp.bind(null, app, { installationProgress: '35, Downloading icon' }), downloadIcon.bind(null, app), @@ -877,6 +883,7 @@ function startTask(appId, callback) { case appdb.ISTATE_PENDING_BACKUP: return backup(app, callback); case appdb.ISTATE_INSTALLED: return handleRunCommand(app, callback); case appdb.ISTATE_PENDING_INSTALL: return install(app, callback); + case appdb.ISTATE_PENDING_FORCE_UPDATE: return update(app, callback); case appdb.ISTATE_ERROR: debugApp(app, 'Apptask launched with error states.'); return callback(null);