Warning when native promise implementation is replaced with bluebird
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
Description
In a node application using highland@2.10.1 I have replaced the native promise implemenation with bluebird@3.4 due to performance consideration via:
```
global.Promise = Bluebird;
```
While highland seems to be working just as fine as before, I lot of warning with the content:
```
(node:1428) Warning: a promise was created in a handler at usr/src/marketing-tasks/node_modules/highland/lib/index.js:517:24 but was not returned from it, see http://goo.gl/rRqMUw
```
The offending code is [index.js in line 517](https://github.com/caolan/highland/blob/2.x/dist/highland.js#L517):
```
function promiseStream(promise) {
if (_.isFunction(promise['finally'])) { // eslint-disable-line dot-notation
// Using finally handles also bluebird promise cancellation
return _(function (push) {
promise.then(function (value) {
return push(null, value); // it complains here
},
function (err) {
return push(err);
})['finally'](function () { // eslint-disable-line dot-notation
return push(null, nil);
});
});
}
```
I am unsure if this is either an issue with how highland.js creates promises or if bluebird's warning system fires a false positive.
This is me asking: Does bluebird's warning has any merit for highland.js? Or should this be an issue on bluebird's side?
Contributor guide
Research direction
Start with dist/highland.js at line 517, in promiseStream, and reproduce the warning using highland@2.10.1 with Bluebird@3.4 assigned to global.Promise. Check whether the promise returned by the then/finally chain is intentionally unhandled and determine whether the warning is caused by Highland or Bluebird. Done means the source of the warning is established and the issue has a verified fix or clear upstream conclusion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100