Last Comment Bug 823371 - Fire "blocked" event if deleteDatabase is blocked by running versionchange transaction
: Fire "blocked" event if deleteDatabase is blocked by running versionchange tr...
Status: RESOLVED FIXED
[tw-dom] btpp-active
:
Product: Core
Classification: Components
Component: DOM: IndexedDB (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla49
Assigned To: Bevis Tseng[:bevistseng][:btseng]
:
Mentors:
: 1220279 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-19 19:59 PST by Jonas Sicking (:sicking) PTO Until July 5th
Modified: 2016-05-18 09:17 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
(v1) Patch: Fire "blocked" event if deleteDatabase is blocked by other open connection. r=khuey (11.40 KB, patch)
2016-05-11 03:17 PDT, Bevis Tseng[:bevistseng][:btseng]
khuey: review+
Details | Diff | Review

Description Jonas Sicking (:sicking) PTO Until July 5th 2012-12-19 19:59:48 PST
Apparently we don't fire a "blocked" event if someone tries to delete a database if we're currently in the process of running a versionchange transaction.
Comment 1 Bevis Tseng[:bevistseng][:btseng] 2016-05-11 02:48:51 PDT
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8dcf73ad13de
Comment 2 Bevis Tseng[:bevistseng][:btseng] 2016-05-11 03:17:17 PDT
Created attachment 8751230 [details] [diff] [review]
(v1) Patch: Fire "blocked" event if deleteDatabase is blocked by other open connection. r=khuey

After further investigation, the "block" event is fired while deleting database if other open connection is available in current implementation.
The remained problem is that we didn't provide correct db's version but "0" as the oldVersion of the blocked event [1][2].

Changes in this patch:
1. SendBlocked with proper db version while deleting database.
2. Two test cases are added to ensure that the "blocked" event will be fired to the deleting request either during the versionchange transaction or after an open request is success with active DB connection.

[1] http://w3c.github.io/IndexedDB/#deleting-a-database
[2] https://hg.mozilla.org/mozilla-central/annotate/043082cb7bd8490c60815f67fbd1f33323ad7663/dom/indexedDB/ActorsParent.cpp#l22231
Comment 3 Kyle Huey [:khuey] (khuey@mozilla.com) 2016-05-16 15:18:21 PDT
Comment on attachment 8751230 [details] [diff] [review]
(v1) Patch: Fire "blocked" event if deleteDatabase is blocked by other open connection. r=khuey

Review of attachment 8751230 [details] [diff] [review]:
-----------------------------------------------------------------

Hmm, I thought it was harder than this when I looked at bug 1220279.  Please double check that that bug is an exact duplicate of this.
Comment 4 Bevis Tseng[:bevistseng][:btseng] 2016-05-16 23:37:34 PDT
*** Bug 1220279 has been marked as a duplicate of this bug. ***
Comment 5 Bevis Tseng[:bevistseng][:btseng] 2016-05-16 23:43:49 PDT
treeherder result in comment 1 looks fine.
Comment 7 Ryan VanderMeulen [:RyanVM] 2016-05-18 09:17:17 PDT
https://hg.mozilla.org/mozilla-central/rev/d818be07b423

Note You need to log in before you can comment on or make changes to this bug.