Closed Bug 1563299 Opened 5 years ago Closed 5 years ago

Correct the IDB_LOG for IDBTransaction while firing a complete/abort event

Categories

(Core :: Storage: IndexedDB, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: tt, Assigned: tt)

References

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/0671407b7b9e3ec1ba96676758b33316f26887a4/dom/indexedDB/IDBTransaction.cpp#758

IDBTransacation::FireCompleteOrAbortEvent() fires an event based on the aResult, but logs IDB_LOG based on mAbortCode.

The problem would occur while these two are different. We should change the if-check and maybe have an assertion for ensuring things there.

IDBTransaction generates IDB_LOG base on the mAbortCode, but it fires event
according to the argument "aResult" of FireCompleteOrAbortEvents(). It's
possible to have a situation that IDBTransaction hasn't been aborted yet, but
the transaction on the parent process is aborted and propagate the reason to
IDBTransaction. In this case, IDBTransaction would still fire an abort event as
expected. However, the IDB_LOG would show that it fired a complete event.

Therefore, this patch corrects the behavior and adds an assertion to ensure it's
only possible that parent process tells child process to abort at the last
minate rather than the case of parent is canceling the abort.

Pushed by shes050117@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f712a42318c8
Update the mAbortCode if the IDBTransaction has been aborted yet to correct the IDB_LOG; r=asuth
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: