Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

destroy() does not actually delete IndexedDB database #1583

Closed
perliedman opened this Issue · 5 comments

3 participants

@perliedman

When destroying a database, the wrong name is used when calling indexedDB.deleteDatabase.

To reproduce:

var db = new PouchDB('test');
db.destroy();

When the database is opened, the name _pouch_test is passed to indexedDB.open. When indexedDB.deleteDatabase is called, it is passed the name _pouch_EFA06E9B-996E-4500-8906-E130D41C24C7. The result is that the database _pouch_test is never deleted.

Tested with 2.0.0 and the nightly build from 2014-03-06 on Chrome 33 for Windows.

@calvinmetcalf

that would because it's deleting based on the id not the name even though those used to be the same thing

@calvinmetcalf

(in the mean time you can use PouchDB.destroy('test'))

@calvinmetcalf

god this is going to be why a lot of the tests are wonky

@daleharvey
Owner

we only do 3 db.destroys in the tests and teardown should catch it, I dont think it will effect the tests

But yeh we defeinitely wanna test this, we had the same test for PouchDB.destroy to ensure the data had gone

@daleharvey
Owner

fixed in: 5b66897

@daleharvey daleharvey closed this
@sygi sygi referenced this issue from a commit in sygi/pouchdb
@calvinmetcalf calvinmetcalf (#1583) - properly destroy idb (and websql) f2e0793
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.