4 ms·
PromisifyAll is awesome... until you realize some code you are using is doing some seriously crazy stuff. For example, Mongoose takes all of methods on the pro
by vkjv 13y ago
PromisifyAll is awesome... until you realize some code you are using is doing some seriously crazy stuff.
For example, Mongoose takes all of methods on the prototype during object creation and replaces them with ones that run middleware. This means that if you try to use one of the promisified methods, none of the middleware gets called.
- jclem 13y agoI've never had that problem. My recommendation would be to not use it on Mongoose objects, then.
- esailija 13y agoI made a fix for a mongoose issue that sounds like what you describe and landed it in 1.2.3[1]. Can you verify? And if what you describe is a different issue can you make a github issue? (or is mongoose doing something so crazy that it cannot be helped at all? :P) [1] https://github.com/petkaantonov/bluebird/commit/70f90c33dd944a54d2995ed41f08860cc414f824 https://github.com/petkaantonov/bluebird/commit/70f90c33dd94...