Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome 23.0.1271.17 Uncaught Error: ConstraintError: DOM IDBDatabase Exception 4 #149

Closed
cesine opened this issue Oct 6, 2012 · 1 comment

Comments

@cesine
Copy link

cesine commented Oct 6, 2012

We just updated to Chrome 23.0.1271.17 and we are getting new error(s). I will post this here so that anyone else who gets the errors can share. My plan is to follow sander's issue in #126 and try with a fresh indexeddb and a fresh pouch.js If that doesn't work I will try to fix it and send a pull request.

Files Tested:

  • pouch.alpha.js (from a while ago, with our Eval workarounds)
  • pouch.js (current version with deps external)

Uncaught Error: ConstraintError: DOM IDBDatabase Exception 4

console.info(name + ': Open Database');

  req.onupgradeneeded = function(e) {
    var db = e.target.result;
    db.createObjectStore(DOC_STORE, {keyPath : 'id'})
Uncaught Error: ConstraintError: DOM IDBDatabase Exception 4
      .createIndex('seq', 'seq', {unique : true});
    db.createObjectStore(BY_SEQ_STORE, {autoIncrement : true});
    db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'});
  };

And Uncaught TypeError: Cannot call method 'toLowerCase' of undefined (on a non-existent IDBDatabaseException)

var idbError = function(callback) {
  return function(event) {
    var code = event.target.errorCode;
    call(callback, {
      status: 500,
      error: event.type,
      reason: Object.keys(IDBDatabaseException)[code-1].toLowerCase()
Uncaught TypeError: Cannot call method 'toLowerCase' of undefined
    });
  }
};

It is looking for exception 19, when there are only 14 known exceptions

Object.keys(IDBDatabaseException)
["NO_ERR", "UNKNOWN_ERR", "NON_TRANSIENT_ERR", "CONSTRAINT_ERR", "DATA_ERR", "NOT_ALLOWED_ERR", "TRANSACTION_INACTIVE_ERR", "READ_ONLY_ERR", "VER_ERR", "NOT_FOUND_ERR", "ABORT_ERR", "TIMEOUT_ERR", "QUOTA_ERR", "toString"]
code
20
Object.keys(IDBDatabaseException).length
14

@cesine
Copy link
Author

cesine commented Oct 6, 2012

yep, it looks like a fresh indexeddb solves it, as in #126

Solution:

  • loaded the app in a new chrome extension with no previous pouches/indexeddb, and created a fresh pouch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant