PolymerElements / app-pouchdb

Custom Elements for working with PouchDB.
49 stars 27 forks source link

revsLimit and adapter variables switched in __computeDb #22

Open jarrodek opened 8 years ago

jarrodek commented 8 years ago

Description

In the AppPouchDBDatabaseBehavior function __computeDb has switched arduments. According to db attribute definition this is computed by __computeDb(dbName, adapter, revsLimit) however, actual function body is __computeDb: function(name, revsLimit, adapter). It causes error when trying to put anything to the data store:

Uncaught TypeError: Cannot read property '2' of undefined at traverseRevTree (VM4319 pouchdb.js:3619) at stem (VM4319 pouchdb.js:3914) at merge (VM4319 pouchdb.js:3927) at nextDoc (VM4319 pouchdb.js:5953) at VM4319 pouchdb.js:5959 at _Map.15._Map.forEach (VM4319 pouchdb.js:2574) at processDocs (VM4319 pouchdb.js:5933) at idbProcessDocs (VM4319 pouchdb.js:6331) at checkDone (VM4319 pouchdb.js:6345) at IDBRequest.readMetadata (VM4319 pouchdb.js:6355)

This error is caused because of the switch. At this point PouchDB is expecting different parameter. After I switch back this parameters in by bower_components folder my test cases started working.

kasperstorgaard commented 7 years ago

made a pull for this: https://github.com/PolymerElements/app-pouchdb/pull/52