Promise never returns when using Pouch 5.0.0
Ampakinetic opened this issue · 7 comments
It could be related to this issue? pouchdb-community/pouchdb-replication-stream#41
Thanks for reporting.
If that's the case, using 'pouchdb/extras/promise' instead of 'pouchdb-promise' might help. Worth trying, I guess.
But could you give a full example of how to reproduce this?
Thank you, if I use:
var db = require('http-pouchdb')(PouchDB, 'http://localhost:51738/');
Then it never comes back from the put
But if I use:
var db = new PouchDB("http://localhost:51738/testing");
then it works, with the full code below:
var db = new PouchDB("http://localhost:51738/testing");
db.put({ _id: 'mydoc', "test": "yes" }).then(function (response) {
db.allDocs({
include_docs: true,
attachments: true
}).then(function (result) {
res.send(JSON.stringify(result));
}).catch(function (err) {
console.log(err);
});
}).catch(function (err) {
console.log(err);
});
Are you able to reproduce the issue as well or was I making a mistake?
Well, I can see that http-pouchdb is quite broken nowadays. See also #3. Seems like the whole concept needs to be rethought.
As soon as https://travis-ci.org/pouchdb/http-pouchdb/builds/86801127 passes, I'm releasing a new version that fixes this (tests pass locally, but I want that check).
Code for the fix is in 6180f32
marten@procyon:~/git/http-pouchdb$ npm publish
+ http-pouchdb@1.1.3