arobson / rabbot

Deprecated: Please see https://github.com/Foo-Foo-MQ/foo-foo-mq
MIT License
277 stars 129 forks source link

fix: switch promises from when to bluebird #95

Closed mrfelton closed 6 years ago

mrfelton commented 7 years ago

Fix for #94

weyert commented 6 years ago

When I am using this PR I am getting the following error referring domain.js:293:12 while this should be Broker.publish (line 300:4):

(node:53206) Warning: a promise was created in a handler at domain.js:293:12 but was not returned from it, see http://goo.gl/rRqMUw
    at Promise.then (/Users/xxxxx/node_modules/bluebird/js/release/promise.js:125:17)

Stack:

[ '    at Promise.then (/Users/xxx/backend/node_modules/sequelize/lib/promise.js:21:17)',
  '    at Broker.publish (/Users/xxxx/backend/node_modules/rabbot/src/index.js:308:4)',
  '    at Promise (/Users/xxxx/backend/node_modules/trailpack-tasker2/lib/Client.js:38:19)',
  '    at new Promise (<anonymous>)',
  '    at Client.publish (/Users/xxxx/backend/node_modules/trailpack-tasker2/lib/Client.js:18:12)',
  '    at Promise (/Users/xxxx/backend/api/services/WebhookService.js:18:23)',
  '    at new Promise (<anonymous>)',
  '    at WebhookService._dispatchWebhook (/Users/xxxx/backend/api/services/WebhookService.js:17:12)',
  '    at hooks.map.item (/Users/xxxx/backend/api/services/WebhookService.js:64:46)',
  '    at Array.map (<anonymous>)',
  '    at Model.app.orm.Webhook.findAll.then.hooks (/Users/xxxx/backend/api/services/WebhookService.js:62:34)',
  '    at bound (domain.js:280:14)',
  '    at Model.runBound (domain.js:293:12)' ]
arobson commented 6 years ago

@mrfelton - version 2 is dropping external promise libraries altogether in favor of using native promises. Unless there's compelling evidence to suggest that there's a notable difference in performance, I'd rather stick with native Promises going forward vs. switching to a different promise library.