[Webkit-unassigned] [Bug 143126] New: IndexedDB: index creation fails after multiple versionchange events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 26 21:00:58 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=143126

            Bug ID: 143126
           Summary: IndexedDB: index creation fails after multiple
                    versionchange events
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: taylor.buley at mcnaughton.media

Created attachment 249548
  --> https://bugs.webkit.org/attachment.cgi?id=249548&action=review
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.

https://gist.github.com/buley/eca47cda4979c74174c6

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150327/22268ff0/attachment-0002.html>


More information about the webkit-unassigned mailing list