Closed Bug 1476268 Opened 3 years ago Closed 3 years ago
Fix uncaught storage
.local IDBTransaction error on explicit IDBTransaction abort
59 bytes, text/x-review-board-request
When an IDBTransaction is explicitly aborted  the transaction's promise is going to be an uncaught rejected error (also, the error property of the IDBTransaction is actually going to be null  when the transaction is explicitly aborted, and we are already raising the original error that is making the "set" method to reject the transaction and so we should catch and ignore the rejection on transaction's promise in that case). Also related to that IDB transaction, the ExtensionStorageIDB's set method should wait explicitly that the transaction has been completed before returning (by explicitly await on the promise returned by the Transaction's promiseComplete method ). : using the abort() method, as we do inside the ExtensionStorageIDB's set method when we get an exception while storing a set of values inside the storage.local IndexedDB backend: https://searchfox.org/mozilla-central/rev/b0275bc977ad7fda615ef34b822bba938f2b16fd/toolkit/components/extensions/ExtensionStorageIDB.jsm#92 : as also mentioned in the docs related to IDBTransaction.error on MDN https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/error : https://searchfox.org/mozilla-central/rev/b0275bc977ad7fda615ef34b822bba938f2b16fd/toolkit/modules/IndexedDB.jsm#252-254
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
Priority: -- → P1
Comment on attachment 8992621 [details] Bug 1476268 - Fix uncaught storage.local IDBTransaction error on explicit IDBTransaction abort. https://reviewboard.mozilla.org/r/257498/#review264416 ::: toolkit/components/extensions/ExtensionStorageIDB.jsm:222 (Diff revision 1) > + // We can ignore this rejection because we are aborting the transaction explicitly, > + // and so the transaction.error would be actually null, and we are already rejecting > + // the original error below. We ignore this rejection because we are explicitly aborting the transaction, the transaction.error will be null, and we throw the original error below.
Attachment #8992621 - Flags: review?(mixedpuppy) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/5b6028970a75 Fix uncaught storage.local IDBTransaction error on explicit IDBTransaction abort. r=mixedpuppy
You need to log in before you can comment on or make changes to this bug.