Fix uncaught storage.local IDBTransaction error on explicit IDBTransaction abort

RESOLVED FIXED in Firefox 63

Status

enhancement
P1
normal
RESOLVED FIXED
11 months ago
11 months ago

People

(Reporter: rpl, Assigned: rpl)

Tracking

unspecified
mozilla63
Dependency tree / graph
Bug Flags:
qe-verify -

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

11 months ago
When an IDBTransaction is explicitly aborted [1] 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 [2] 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 [3]).

[1]: 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
[2]: as also mentioned in the docs related to IDBTransaction.error on MDN https://developer.mozilla.org/en-US/docs/Web/API/IDBTransaction/error
[3]: https://searchfox.org/mozilla-central/rev/b0275bc977ad7fda615ef34b822bba938f2b16fd/toolkit/modules/IndexedDB.jsm#252-254
Assignee

Updated

11 months ago
Blocks: 1474562
Depends on: 1470213
Assignee

Updated

11 months ago
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
Priority: -- → P1

Comment 2

11 months ago
mozreview-review
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+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Updated

11 months ago
Iteration: --- → 63.3 - Aug 6

Comment 5

11 months ago
Pushed by luca.greco@alcacoop.it:
https://hg.mozilla.org/integration/autoland/rev/5b6028970a75
Fix uncaught storage.local IDBTransaction error on explicit IDBTransaction abort. r=mixedpuppy

Comment 6

11 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/5b6028970a75
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63

Updated

11 months ago
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.