You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/10/25 03:26:24 UTC

[06/17] git commit: Added comments explaining launch handling.

Added comments explaining launch handling.


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/55cf7bdc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/55cf7bdc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/55cf7bdc

Branch: refs/heads/master
Commit: 55cf7bdcc248c699ef956302e036a5395eb15f6c
Parents: 6ce2740
Author: Max Woghiren <ma...@gmail.com>
Authored: Tue Sep 30 15:50:25 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Oct 24 20:44:14 2014 -0400

----------------------------------------------------------------------
 .../node_modules/cordova-harness-client/pushsession.js       | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/55cf7bdc/harness-push/node_modules/cordova-harness-client/pushsession.js
----------------------------------------------------------------------
diff --git a/harness-push/node_modules/cordova-harness-client/pushsession.js b/harness-push/node_modules/cordova-harness-client/pushsession.js
index 05681b2..ae5aa31 100644
--- a/harness-push/node_modules/cordova-harness-client/pushsession.js
+++ b/harness-push/node_modules/cordova-harness-client/pushsession.js
@@ -234,7 +234,9 @@ PushSession.prototype.push = function(forceLaunch) {
         var pushList = buildPushList(self.assetManifest_ || {}, assetMap);
         if (deleteList.length === 0 && pushList.length === 0) {
             console.log('Application already up-to-date.');
-            return false; // appChanged
+            // The app hasn't changed, so resolve the promise saying so.
+            // It won't be launched unless `forceLaunch` is true.
+            return false;
         }
         var p;
         // TODO: It might be faster to use Zip even when some files exist.
@@ -246,10 +248,12 @@ PushSession.prototype.push = function(forceLaunch) {
         return p.then(function() {
             return self.deleteFiles_(deleteList);
         }).then(function() {
-            return true; // appChanged
+            // The app has changed, so resolve the promise saying so.  The app will be launched with the changes.
+            return true;
         });
     }).then(function(appChanged) {
         // Determine whether we should launch the app.
+        // We want to launch the app if we've been told to force it or if the app has changed.
         shouldLaunch = forceLaunch || (self.launchAfterPush && appChanged);
         if (shouldLaunch) {
             return self.harnessClient_.launch(self.appId_);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org