This is awesome! As you test out the various browsers, have you noticed any implementation differences, other than those I list below?
On Friday, July 13, 2012 12:04:14 AM UTC-7, Abhinav Asthana wrote:
Thanks for the links Alec. The bug seems to have been fixed. Is there some sort of an official doc for the IndexedDB implementation for Chrome? I was thinking of writing a tutorial/how-to for newcomers and a reference of some sort would be great.
We're working hard to ensure that the Chrome IndexedDB implementation matches the spec and is compatible with all of the other browser implementations. Chrome specific documentation should not be necessary. In fact, we've been contributing to the docs on MDN:
While we have a handful of known bugs around edge cases in the spec that apps are unlikely to hit, and presumably some bugs we're not aware of yet, there are only two deviations from the spec that you need to be aware of:
Versioning - Chrome still uses the older db.setVersion() API for versioning, rather than open(name, version) / onupgradeneeded callback now defined in the spec. We're actively working to switch over to the mechanism in the spec, and hope to land that for M22. (Our plan is to maintain the old API as well during a transition period, with console warnings.)
Blobs - Chrome does not support storing Blob/File/FileList objects in IDB stores (this support is not mentioned directly in the IDB spec, but rather indirectly by reference to the HTML "structured clone algorithm" which enumerates these types). With Chrome's multiprocess architecture this turns out to be nontrivial to do in an efficient way; we have designs in progress, but no ETA on support.
We're landing patches like crazy to match the spec, so the closer to Canary you're running the more spec-compliant the implementation should be. We'll continue to send announcement mail here for any breaking changes apps are likely to hit.
On Friday, July 13, 2012 12:41:51 AM UTC+5:30, Alec Flett wrote:
Yep, you got that exactly right. Here's the announcement:
I just came across this thread which says a call to db.transaction should not be present in a setVersion call. This does show up as an error at the db.transaction call inside getAllRequests() in my code:
Uncaught Error: InvalidStateError: DOM IDBDatabase Exception 11 requester.js:2988
Is this error the cause for the object stores not getting created? I am wondering if there is anything else which might be wrong with the initialization code. I'll move the db.transaction call into an oncomplete event and see if this fixes the issue.
On Thursday, July 12, 2012 9:46:40 PM UTC+5:30, Joshua Bell wrote:
Yes, we recently updated Chrome's IndexedDB implementation here to match the spec. The numeric constants were removed, you need to pass in strings. So that we didn't break deployed code the methods currently accept both numbers and strings during a transition period, but we plan to drop number support eventually. This is tracked in https://bugs.webkit.org/show_bug.cgi?id=85315 - in the mean time we issue console warnings so that app developers have some motivation to update before the legacy support is dropped.
The above just explains the console warning. The exception is unrelated. Per the spec (and implementation) NotFoundError is thrown by IDBDatabase.transaction() when the specified object store is not found in the database, so it looks like that could be an error in your web app's logic?
On Thu, Jul 12, 2012 at 3:18 AM, PhistucK wrote:
Well, that is what the specifications document says -
On Thu, Jul 12, 2012 at 11:50 AM, Abhinav Asthana wrote:
I have been using IndexedDB for my extension called Postman in the Chrome Web Store. Just yesterday I started receiving some bug reports like these:
Numeric transaction modes are deprecated in IDBDatabase.transaction. Use "readonly" or "readwrite". Uncaught Error: NotFoundError: DOM IDBDatabase Exception 8 requester.js:2768
postman.indexedDB.addCollection requester.js:2768 postman.collections.addRequestToCollection requester.js:2230
(anonymous function) requester.js:2443 f.event.dispatch jquery.min.js:3 f.event.add.h.handle.i jquery.min.js:3
Would be great if anyone can shed some light on this. Is this an upcoming change in Chrome or something has changed in the IndexedDB spec itself? Is there something I might be doing wrong? Some sample code:
var IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;
var trans = db.transaction(["requests"], IDBTransaction.READ_WRITE);
This seems to be working fine till now and has been mentioned in almost all resources I looked up.