- From: Joshua Bell <notifications@github.com>
- Date: Wed, 22 Jun 2016 14:56:08 -0700
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc:
- Message-ID: <w3c/IndexedDB/issues/78@github.com>
The "steps for opening a database" ensure that if an upgrade transaction is running that a subsequent open request with a higher version is "deferred" until the previous request is completed. And it should not be necessary to assign a "versionchange" handler in your "upgradeneeded" handler.
For example, the following should work:
```js
indexedDB.open('db', 1).onsuccess = e => {
let db = e.target.result;
db.onversionchange = e => db.close(); // Get out of the way.
};
indexedDB.open('db', 2).onblocked = e => alert('should not happen!');
```
It's reasonable to expect the same thing for deletes:
```js
indexedDB.open('db', 1).onsuccess = e => {
let db = e.target.result;
db.onversionchange = e => db.close(); // Get out of the way.
};
indexedDB.deleteDatabase('db').onblocked = e => alert('should not happen!');
```
... but the spec does not require that. Firefox behaves as expected. Chrome does not but we're fixing to match Firefox.
We should add a clause to the "steps for deleting a database" to wait for running upgrades.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/78
Received on Wednesday, 22 June 2016 21:56:38 UTC