Closed Bug 618140 Opened 9 years ago Closed 9 years ago

IndexedDB: Don't fire success event callbacks once a transaction has been aborted

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: bent.mozilla, Assigned: bent.mozilla)

Details

Attachments

(1 file, 1 obsolete file)

Once a transaction has been aborted we should suppress any pending success event callbacks.
This is part of the last set of IndexedDB bugs we've deemed necessary in order to ship 2.0, blocking beta9.
blocking2.0: ? → beta9+
Attached patch Patch, v1 (obsolete) — Splinter Review
Attachment #497326 - Flags: review?(jonas)
Comment on attachment 497326 [details] [diff] [review]
Patch, v1

We should fire an error event with ABORT_ERR rather than nothing.
Attachment #497326 - Flags: review?(jonas) → review-
Attached patch Patch, v2Splinter Review
Ok, this converts everything to ABORT_ERR events instead.
Attachment #497326 - Attachment is obsolete: true
Attachment #497435 - Flags: review?(jonas)
Comment on attachment 497435 [details] [diff] [review]
Patch, v2

>@@ -370,16 +378,22 @@ AsyncConnectionHelper::OnSuccess(nsIDOME
...
>+#ifdef DEBUG
>+  if (mTransaction && !mTransaction->TransactionIsOpen()) {
>+    NS_ASSERTION(mTransaction->IsAborted(), "How else can this be closed?!");
>+  }
>+#endif

NS_ASSERTION(!mTransaction ||
             mTransaction->TransactionIsOpen() ||
             mTransaction->IsAborted(), "How else can this be closed?!")

Also, shouldn't TransactionIsOpen simply be named to IsOpen?

>+#ifdef DEBUG
>+    if (mTransaction && !mTransaction->TransactionIsOpen()) {
>+      NS_ASSERTION(mTransaction->IsAborted(), "How else can this be closed?!");
>+  }
>+#endif

Same same.

>@@ -931,59 +944,60 @@ CommitHelper::Run()
...
>+    mTransaction->mFiredCompleteOrAbort = true;

#ifdef DEBUG?

r=me with that.
Attachment #497435 - Flags: review?(jonas) → review+
http://hg.mozilla.org/mozilla-central/rev/a1f2e2bb9a7a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
As per today's meeting, beta 9 will be a time-based release. Marking these all betaN+. Please move it back to beta9+ if  you believe it MUST be in the next beta (ie: trunk is in an unshippable state without this)
blocking2.0: beta9+ → betaN+
Component: DOM → DOM: IndexedDB
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.