Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: returning promises created in handlers #31

Closed
wants to merge 1 commit into from

Conversation

D1plo1d
Copy link

@D1plo1d D1plo1d commented Jan 12, 2018

See: http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-was-not-returned-from-it

This pull request resolved the warnings I received when using iterall with Bluebird installed as the global Promise object (global.Promise = require('bluebird')):

(node:16490) Warning: a promise was created in a handler at [REDACTED]/node_modules/iterall/index.js:650:23 but was not returned from it, see http://goo.gl/rRqMUw
    at Function.Promise.cast ([REDACTED]/node_modules/bluebird/js/release/promise.js:196:13)
    at [REDACTED]/node_modules/iterall/index.js:650:23
    at runCallback (timers.js:773:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate [as _immediateCallback] (timers.js:711:5)

@leebyron
Copy link
Owner

Unfortunately adding a return here creates a memory leak. A line like this used to exist and was removed to fix the leak. Bluebird also recommends explicitly returning null from the handler, so lets try that instead.

@leebyron leebyron closed this in e76533a Jan 22, 2018
@D1plo1d
Copy link
Author

D1plo1d commented Jan 23, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants