senecajs / seneca-transport

Seneca micro-services message transport over TCP and HTTP.
MIT License
63 stars 45 forks source link

handle_entity doesn't support strict.result = false mode #35

Closed devfacet closed 8 years ago

devfacet commented 9 years ago

{strict: {result: false} doesn't play well with https://github.com/rjrodger/seneca-transport/blob/master/lib/transport-utils.js#L466 … when raw is just a string.

REF: https://twitter.com/cmuratfatih/status/648306487241109504

Trello Card

devfacet commented 9 years ago

@rjrodger : any news about this issue?

What is the best way to check Seneca options in handle_entity function function? Maybe I could do a quick fix for the issue.

rjrodger commented 8 years ago

@cmfatih seems like this is fixed in the latest version of handle_entity but not clear to me immediately - can you take a quick look?

devfacet commented 8 years ago

it doesn't work

// server
require('seneca')({strict: {result: false}})
  .add({role: 'foo', cmd: 'bar'}, function(msg, done) { return done(null, 'hello'); })
  .act({role: 'foo', cmd: 'bar', arg1: 1, arg2: 2}, console.log)
  .listen(process.env.NODE_PORT || 3001);
2016-02-04T22:20:35.263Z i35x8ewg2t83/1454624435253/15215/- INFO    hello   Seneca/1.1.0/i35x8ewg2t83/1454624435253/15215/- 
2016-02-04T22:20:35.539Z i35x8ewg2t83/1454624435253/15215/- INFO    listen  3001    
null 'hello'
// client
require('seneca')({strict: {result: false}})
  .client({port: process.env.NODE_PORT || 3001})
  .act({role: 'foo', cmd: 'bar', arg1: 1, arg2: 2}, function(err, msg) {
    console.log(err, msg);
    process.exit(0);
  });
2016-02-04T22:22:12.388Z hz6tua95dj9u/1454624532377/15274/- INFO    hello   Seneca/1.1.0/hz6tua95dj9u/1454624532377/15274/- 
2016-02-04T22:22:12.722Z hz6tua95dj9u/1454624532377/15274/- INFO    client  {port:3001} 
null null
npm list --dept=1

└─┬ seneca@1.1.0
  ├── archy@1.0.0
  ├── eraro@0.4.1
  ├── gate-executor@0.3.2
  ├── gex@0.2.2
  ├── jsonic@0.2.2
  ├── lodash@4.0.1
  ├── lru-cache@4.0.0
  ├── minimist@1.2.0
  ├── nid@0.3.2
  ├── norma@0.3.0
  ├── parambulator@1.5.1
  ├── patrun@0.5.0
  ├── rolling-stats@0.1.1
  ├── semver@5.1.0
  ├── seneca-basic@0.4.0
  ├── seneca-cluster@0.0.1
  ├── seneca-mem-store@0.5.0
  ├── seneca-repl@0.0.1
  ├── seneca-transport@0.9.1
  ├── seneca-web@0.7.0
  ├── use-plugin@0.3.1
  └── zig@0.1.1
mcdonnelldean commented 8 years ago

Going to close this as it's way out of date. @fatihcode If this is still outstanding let me know and I will investigate.