Created attachment 249548 [details]
some IDB js to run in console
Background: I've found it challenging to keep IDB database connections open for reuse and have instead come to adopt a pattern where every open connection is closed after a single transaction (such as creating an object store or index) has been committed and fired its `complete` event. This is somewhat unorthodox compared to common patterns of reuse seen on the web but my IDB library is very old and time has told me this is the sanest approach when dealing with multiple tabs, etc. As a result, my typical "install code" chains together a number of consecutive `versionchange` transactions, one to create the database and one for each store and index.
I've been having trouble creating indexes in iOS8. The problem I see is that my indexes all create fine and and the transactions commit successfully as well but after all is said and done only the index for the last transaction to commit is available on the object store.
Attempting to create a test case for this, I've managed to cobble together something that throws an interesting error in WKWebViews in iOS 8.2 after a couple `versionchange` events. The expected result, confirmed as successful in recent Chrome and Firefox builds, would be a database on version `3` with an object store and two indexes. Instead, in the WKWebView a `NotFoundError` is thrown: "DOM IDBDatabase Exception 8: An operation failed because the requested database object could not be found."
The console.logs show this database as existing and on the correct version number prior to a failed opening after the second `versionchange`. I'm not sure it's exactly the issue I was attempting to document, but it seems at least related as it also appears for me when creating indexes after multiple `versionchange` events.
This should be working fine with modern IDB.
Please try in a WebKit nightly or Safari Tech Preview.