title: What to return for Bluebird Promise?
body: <p>happy new year!</p>
  
  <p>I would be very thankful if anybody could give me a hint on an issue with  <a href="http://bluebirdjs.com/docs/api/promise.promisify.html" rel="nofollow noreferrer">Bluebird's promisify</a>. Without further ado, the situation is as follows. I have this piece of code:</p>
  
  <pre><code>/**
  * Set up /website endpoint.
  * @param {Object} router A Koa router
  */
  module.exports = function(router) {
  /**
  * POST /website
  *
  * Records the activity of following an external
  * website URL.
  */
    router.post('/website', validator, (ctx, next) =&gt; co(function * () {
      var address = forwardedFor(ctx.request, ctx.request.headers);
      var orgId = /\/?([^\-]+).*/.exec(ctx.request.body.path)[1];
  
      var visit = {
        websiteUrl: ctx.request.body.url,
        path: ctx.request.body.path,
        clientIp: address.ip,
        userAgent: ctx.request.headers['user-agent'],
        organization: orgId
      };
      yield tracker.track('website_visit', visit);
      log.info('Tracked [%s] website visit from client %s@%s%s', visit.websiteUrl, address.ip, orgId, visit.path);
  
      ctx.status = 200;
      ctx.body = {
        success: true,
        timestamp: Date.now(),
        data: visit
      };
      return next();
    })());
  };
  </code></pre>
  
  <p>which at certain point calls:</p>
  
  <pre><code>/**
  * Register the `event` with the given `name`.
  * @method track
  * @param  {String} name  The name or type of the event to be saved.
  * @param  {Object} event Payload to register as an event.
  * @return {Promise}       A promise on tracking the event.
  */
  function track(name, event) {
    var entity = seneca.make(DEFAULT_BASE, name, event);
    var save$ = Promise.promisify(entity.save$, { context: entity });
    return save$();
  }
  </code></pre>
  
  <p>This finally calls: </p>
  
  <pre><code>module.exports = function phonecall() {
    var seneca = this;
  
    seneca.add('cmd:save,role:entity,name:website_visit', function(msg, respond) {
      var visit = JSON.parse(JSON.stringify(msg.ent.data$(false)));
      Organization.where('account_no', 'like', `%${visit.organization}%`)
        .fetch()
        .then(function(org) {
          return User
            .where('id_organization', org.get('id'))
            .fetch()
            .then(function(user) {
              delete visit.organization;
              var v = new WebsiteVisit(visit);
              user.websiteVisits().create(v);
              return user.save(null, {
                method: 'update'
              });
            });
        })
        .then((model) =&gt; {
          return {
            ok: true,
            model: model
          };
        })
        .catch((err) =&gt; {
          return {
            ok: false,
            why: err.message || err
          };
        }).asCallback(respond);
    });
  
    return {
      name: PLUGIN_NAME
    };
  };
  </code></pre>
  
  <p>That is on a complete different application.</p>
  
  <p>The main problem is that everything runs smoothly, and the model is inserted into the database. However, <code>yield tracker.track('website_visit', visit);</code> takes forever and doesn't behave asynchronously, which launches a timeout error for the already completed function.</p>
  
  <p>The ideal behaviour for <code>yield tracker.track('website_visit', visit);</code> would be to operate on a different thread (asynchronously), as a normal promise should, but isn't acting as such...</p>
  
  <p>Thanks in advance for any help provided.</p>