Fire "blocked" event if deleteDatabase is blocked by running versionchange transaction

RESOLVED FIXED in Firefox 49

Status

()

Core
DOM: IndexedDB
RESOLVED FIXED
5 years ago
a year ago

People

(Reporter: sicking, Assigned: bevis)

Tracking

unspecified
mozilla49
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(firefox49 fixed)

Details

(Whiteboard: [tw-dom] btpp-active)

Attachments

(1 attachment)

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.
Assignee: nobody → btseng
Status: NEW → ASSIGNED
https://treeherder.mozilla.org/#/jobs?repo=try&revision=8dcf73ad13de
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
Attachment #8751230 - Flags: review?(khuey)
Whiteboard: [tw-dom] btpp-active
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.
Attachment #8751230 - Flags: review?(khuey) → review+
Duplicate of this bug: 1220279
treeherder result in comment 1 looks fine.
Keywords: checkin-needed
Attachment #8751230 - Attachment description: (v1) Patch: Fire "blocked" event if deleteDatabase is blocked by other open connection. → (v1) Patch: Fire "blocked" event if deleteDatabase is blocked by other open connection. r=khuey

Comment 6

a year ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d818be07b423
Keywords: checkin-needed

Comment 7

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d818be07b423
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.