Bug 1542181 - IndexedDB.jsm Transaction promiseCompleted should reject on a transaction abort event. r=kmag a=RyanVM
authorLuca Greco <lgreco@mozilla.com>
Tue, 09 Jul 2019 16:00:03 +0000
changeset 545047 491c5c3abe3a81b64fb4d0430d652af30eecb032
parent 545046 2b6ef3ea5181aab4559623e519a156cfdf589370
child 545048 9d645412277f75684ce8485d3ebbe9db88726a15
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, RyanVM
bugs1542181
milestone69.0
Bug 1542181 - IndexedDB.jsm Transaction promiseCompleted should reject on a transaction abort event. r=kmag a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D36822
toolkit/modules/IndexedDB.jsm
--- a/toolkit/modules/IndexedDB.jsm
+++ b/toolkit/modules/IndexedDB.jsm
@@ -242,26 +242,29 @@ class Transaction {
   constructor(transaction) {
     this.transaction = transaction;
 
     this._completionPromise = new Promise((resolve, reject) => {
       transaction.oncomplete = resolve;
       transaction.onerror = () => {
         reject(transaction.error);
       };
+      transaction.onabort = () => {
+        reject(transaction.error);
+      };
     });
   }
 
   objectStore(name) {
     return new ObjectStore(this.transaction.objectStore(name));
   }
 
   /**
    * Returns a Promise which resolves when the transaction completes, or
-   * rejects when a transaction error occurs.
+   * rejects when a transaction error or abort occurs.
    *
    * @returns {Promise}
    */
   promiseComplete() {
     return this._completionPromise;
   }
 }