New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 595910 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

IndexedDB deleteDatabase doesn't always call callback

Reported by mattlyo...@gmail.com, Mar 17 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Steps to reproduce the problem:
1. Navigate to https://jsfiddle.net/m8haL140/2/
2. Open Console
3. Click 'Create DB'
4. Click 'Delete DB'
5. Wait until 'DB Deleted' message appears in console
6. Click 'Create DB'
7. Click 'Delete DB'
8. Notice 'Deleting..' message is shown in console, indicating click was received and deleteDatabase function was called, however 'DB Deleted' is never shown in console indicating the onsuccess callback is never called.

What is the expected behavior?
'DB Deleted' should be shown in console because onsuccess should be called.

What went wrong?
The DB deletion is not completely processed until the page is reloaded/changed. Upon reloading the page there are no IndexedDB databases visible under the developer tools.

Did this work before? N/A 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 20.0 r0

Additionally in the Resources tab of the developer tools upon refreshing IndexedDB the database is still listed, however clicking on it shows no information.

Other browsers tested:
Firefox 45: OK
Chrome-Beta 50.0.2661.37: FAIL
Chromium 49.0.2623.87: FAIL
 
When clicking the IndexedDB database in the developer tools after 'Delete DB' has been clicked after the 2nd creation prints the following error to the terminal it has been launched from:

[11764:11764:0317/160357:ERROR:CONSOLE(294)] "Uncaught TypeError: Cannot read property 'databaseId' of undefined", source: chrome-devtools://devtools/bundled/resources_module.js (294)

Cc: ranjitkan@chromium.org
Labels: Needs-Feedback
Thanks for filing the issue and providing the example. Tried on Linux OS 14.04 with chrome version 51.0.2681.0. Clicking multiple times deletes the DB, no error thrown in console or seen in the Terminal.

Attached screen shot for the same. 

Tried the same on chrome version 49.0.2623.87. when clicked remove db second time no action takes place just "Deleting.." is displayed. Still no error in console.

Request you to please guide us if any thing is missed out here.

Thanks.!
Screen Shot 2016-03-18 at 12.43.45 PM.png
87.7 KB View Download
No error is ever provided, it just does not call onsuccess the second time. Looks like it might be fixed in version 51 by your screenshot. 

The error in terminal shows when clicking the IndexedDB database (named test) in the developer tools after deleting the db the second time.
Project Member

Comment 4 by sheriffbot@chromium.org, Mar 18 2016

Labels: -Needs-Feedback Needs-Review
Owner: ranjitkan@chromium.org
Status: Assigned (was: Unconfirmed)
Thank you for providing more feedback. Assigning to requester "ranjitkan@chromium.org" for another review.

For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot
Components: -Blink Blink>Storage>IndexedDB

Comment 6 by jsb...@chromium.org, Mar 18 2016

Status: WontFix (was: Assigned)
The deleteDatabase() call is blocked until after the connection is closed. Since the sample does not close the connection, the delete will block until the connection is closed due to garbage collection.

To see this, add:

  deleteDbRequest.on = function(event) {
    console.log('Delete Blocked')
  };

One way to address this is to watch for "versionchange" events and close the connection to unblock later work, e.g. with this addition:

  openDBRequest.onsuccess = function(event) {
    console.log('DB Created');

    var db = openDBRequest.result;
    db.onversionchange = function(e) {
       console.log('version change, closing...');
       db.close();
    };
  };

Note that "blocked" event is only sent if there are still connections open after "versionchange" events have been sent out, so if you apply both patches you won't see "blocked"

Sign in to add a comment