Bug 1294025 - Fix the broken promise chain when recording a crash submission attempt; r?bsmedberg
MozReview-Commit-ID: IkXh14Tta7z
--- 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);