WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
143126
IndexedDB: index creation fails after multiple versionchange events
https://bugs.webkit.org/show_bug.cgi?id=143126
Summary
IndexedDB: index creation fails after multiple versionchange events
Taylor Buley
Reported
2015-03-26 21:00:58 PDT
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.
https://gist.github.com/buley/eca47cda4979c74174c6
Attachments
some IDB js to run in console
(2.66 KB, text/javascript)
2015-03-26 21:00 PDT
,
Taylor Buley
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-04-25 14:59:21 PDT
<
rdar://problem/20699776
>
Brady Eidson
Comment 2
2016-06-01 15:21:51 PDT
This should be working fine with modern IDB. Please try in a WebKit nightly or Safari Tech Preview.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug