jbmusso / gremlin-javascript

JavaScript tools for graph processing in Node.js and the browser inspired by the Apache TinkerPop API
MIT License
214 stars 63 forks source link

Empty array #17

Closed adurrive closed 8 years ago

adurrive commented 8 years ago

Hello, the callback is not called when the response array is empty.

var client = gremlin.createClient();

client.execute('g.V().limit(0)', function(err, results) {
  console.log('hello');
});
jbmusso commented 8 years ago

Thanks for reporting this. I'm going to bed right now so I'll have a look at it tomorrow :P.

adurrive commented 8 years ago

Thanks! I've fixed it locally by pushing a null value on the 204 status code in GremlinClient.prototype.handleMessage. But I'm not sure of the implications.

jbmusso commented 8 years ago

Pushing null properly terminates the stream and I can't see any side-effect by doing so. I just pushed v1.0.2 with this fix on npm.