You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all thank you very much for PouchDB, I think this is a truly awesome project!
Now, I am experiencing a problem using transformers which I was able to reproduce with this jasmine test:
it("shows duplicate outgoing transform calls", function (done) {
var database = new PouchDB("bar", {});
database.transform({
incoming: function incoming(doc) {
console.log("incoming called for doc", doc);
return doc;
}, outgoing: function outgoing(doc) {
console.log("outgoing called for doc", doc);
return doc;
}
});
database.put({ _id: "1", val: "bar" }).then(function () {
return database.close();
}).then(function () {
database = new PouchDB("bar", {});
database.transform({
incoming: function incoming(doc) {
console.log("incoming called for doc", doc);
return doc;
}, outgoing: function outgoing(doc) {
console.log("outgoing called for doc", doc);
return doc;
}
});
database.get("1").then(function (doc) {
return database.destroy();
}).then(function () {
done();
});
});
});
The console output I get is this (consistent with a behavior I saw in my production code):
LOG: 'incoming called for doc', Object{_id: '1', val: 'bar'}
LOG: 'outgoing called for doc', Object{val: 'bar', _id: '1', _rev: '1-506c4ea0b5a45566efbb9b6013ebecf7'}
LOG: 'outgoing called for doc', Object{val: 'bar', _id: '1', _rev: '1-506c4ea0b5a45566efbb9b6013ebecf7'}
I am using PouchDB 5.3.2 together with transform-pouch 1.1.1. This happens in my production code when an app is started with a DB containing a few documents and getting the first time any one of these documents. Subsequent calls to get() work as expected, i.e. outgoing is called only once. I think this might be a bug, isn't it?
Kind Regards
Sven
The text was updated successfully, but these errors were encountered:
Hey guys,
first of all thank you very much for PouchDB, I think this is a truly awesome project!
Now, I am experiencing a problem using transformers which I was able to reproduce with this jasmine test:
The console output I get is this (consistent with a behavior I saw in my production code):
I am using PouchDB 5.3.2 together with transform-pouch 1.1.1. This happens in my production code when an app is started with a DB containing a few documents and getting the first time any one of these documents. Subsequent calls to get() work as expected, i.e. outgoing is called only once. I think this might be a bug, isn't it?
Kind Regards
Sven
The text was updated successfully, but these errors were encountered: