brianleroux / lawnchair

A lightweight clientside JSON document store,
http://brianleroux.github.com/lawnchair
MIT License
2.13k stars 246 forks source link

IndexedDB adapter fails in FF4+ #68

Open prashantak opened 13 years ago

prashantak commented 13 years ago

While running the examples on http://westcoastlogic.com/lawnchair/saving/ I got the following error

[Break On This Error] var request = obj.key ? store.put(obj, obj.key) : store.put(obj);
error in indexed-db adapter! error undefined
indexed-db.js (line 87)

Going through the indexed-db.js code i found

and similar "teststore" statements throughout the code. Shouldn't the store name be passed as a parameter?

Surprisingly the adapter works in Chrome (14.x).

steverandy commented 12 years ago

I'm using Firefox 9 and getting the similar error.

Data provided to an operation does not meet requirements. [Break On This Error]

var request = obj.key ? store.put(obj, obj.key) : store.put(obj);

Again it works ok on Chrome.

paulirish commented 12 years ago

The indexeddb adapter may have FF issues. I consider this a dupe of #51

someone should add idbwrapper as part of the adapter.

tanx commented 11 years ago

Hi there,

I'm using the current lawnchair build from the master branch in Firefox 21 and I'm getting the following error Messages:

TypeError: getIDBDatabaseException(...) is undefined @ lawnchair-adapter-indexed-db-git.js:123 UnknownError @ lawnchair-adapter-indexed-db-git.js:56

Is anyone else having trouble with this? thanks

evilripper commented 11 years ago

I have the same issue on firefox 21: InvalidStateError var request = this.idb.open(this.name, STORE_VERSION); TypeError: getIDBDatabaseException(...) is undefined if (request.errorCode === getIDBDatabaseException().VERSION_ERR) {

peppelorum commented 11 years ago

IDBDatabaseException seems to be obsolete according to this https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabaseException and should be replaced by DomException but just changing to that doesn't solve it, cause then some Unknown Error occurs and kills my FF (v22).

peppelorum commented 11 years ago

Well, it actually fixed the error, but running on localhost seems not to work for me, but computer.local (or similar) works, I made the change and made PR for this, https://github.com/brianleroux/lawnchair/pull/176

mikeknoop commented 10 years ago

100% of the time in FF25 I get "InvalidStateError" if Firefox privacy settings for "Remember History" are set to "Never Remember History".

I actually get a new error when I toggled it back to "remember history":

NotFoundError: The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened.

Can't seem to get IndexDB back into a working state but at least I can reliably reproduce it now so I can catch the exception and disable storage.

tanx commented 10 years ago

Any update on this? I'd be to do the work to fix this if there are any suggestions. Thanks

felixhammerl commented 9 years ago

i tip my hat to firefox, because this is a useless message:

The operation failed for reasons unrelated to the database itself and not covered by any other error code.

there was a bug here but i don't see how that should apply to a use case where the site is served from a local node instance on http://localhost.

felixhammerl commented 9 years ago

the bug you're seeing occurs when you're trying to fire up an indexed db when you set firefox to private mode or set it to not remember the history. please check if this helps: https://github.com/brianleroux/lawnchair/pull/207