Bug 1294025 - Fix the broken promise chain when recording a crash submission attempt; r?bsmedberg draft
authorGabriele Svelto <gsvelto@mozilla.com>
Mon, 12 Jun 2017 12:00:56 +0200
changeset 592498 351ffae17914bb262a95d021e49e1779ec4ca671
parent 592285 981da978f1f686ad024fa958c9d27d2f8acc5ad0
child 632852 b9579788f800350d3c67b53b022134d4c7c40334
push id63423
push usergsvelto@mozilla.com
push dateMon, 12 Jun 2017 10:21:25 +0000
reviewersbsmedberg
bugs1294025
milestone55.0a1
Bug 1294025 - Fix the broken promise chain when recording a crash submission attempt; r?bsmedberg MozReview-Commit-ID: IkXh14Tta7z
toolkit/crashreporter/CrashSubmit.jsm
--- a/toolkit/crashreporter/CrashSubmit.jsm
+++ b/toolkit/crashreporter/CrashSubmit.jsm
@@ -339,19 +339,20 @@ Submitter.prototype = {
         });
       }
     });
 
     let p = Promise.all(promises);
     let id = this.id;
 
     if (this.recordSubmission) {
-      p = manager.ensureCrashIsPresent(id).then(() => {
-        return manager.addSubmissionAttempt(id, submissionID, new Date());
-      });
+      p = p.then(() => { return manager.ensureCrashIsPresent(id); })
+           .then(() => {
+             return manager.addSubmissionAttempt(id, submissionID, new Date());
+            });
     }
     p.then(() => { xhr.send(formData); });
     return true;
   },
 
   notifyStatus: function Submitter_notify(status, ret) {
     let propBag = Cc["@mozilla.org/hash-property-bag;1"].
                   createInstance(Ci.nsIWritablePropertyBag2);