Re: [IndexedDB] Consider adding a completion event or callback to the IDBDatabase.close() operation (#72)

A `"close"` event is reasonable. Chrome fires one if the connection is closed by some means other than script calling `close()`, e.g. the user clears cookies and other browsing data, the backing store became corrupted or file handles were closed, etc. We've talked about making it fire for `close()` calls too, but no consensus yet. (And yes, returning a Promise if/when we promisify things would make sense.)

But it sounds like you may be hitting a bug in IE. The behavior here is fully defined:

* `close()` sets the __close pending flag__, but doesn't close the connection until all transactions associated with that connection have finished
* An open request with a higher version will wait until all connections with a lower version have closed before proceeding through the upgrade steps.

And so order doesn't even matter. 

You call out "operation blocked" but you don't provide the code you're using. Note that "blocked" events will fire if an upgrade is attempted but the connections aren't closed. That's not an error - it is just telling you that the connections didn't close _yet_. If they do all close — e.g. in response to the "versionupgrade" events they should receive — then the upgrade can proceed merrily.


---
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/72#issuecomment-199090544

Received on Monday, 21 March 2016 02:57:34 UTC