[ https://issues.apache.org/jira/browse/THRIFT-3048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14372864#comment-14372864 ]
Randy Abernethy commented on THRIFT-3048: ----------------------------------------- Hey Will, Thanks for the patch! These two tests used to pass but fail with the patch applied: - nodejs-cpp compact buffered-ip failure(1) - nodejs-cpp compact buffered-ip-ssl failure(1) I am certain it is the test but didn't have time to track it down. If you can update the pull great, otherwise I will fix the test and commit this over the weekend. Best, Randy {noformat} ~/thrift/test$ ./test.sh Apache Thrift - integration test suite Sat Mar 21 08:52:25 PDT 2015 ====================================================== client-server: protocol: transport: result: nodejs-nodejs binary buffered-ip success(0) nodejs-nodejs binary buffered-ip-ssl success(0) nodejs-nodejs binary framed-ip success(0) nodejs-nodejs binary framed-ip-ssl success(0) nodejs-nodejs compact buffered-ip success(0) nodejs-nodejs compact buffered-ip-ssl success(0) nodejs-nodejs compact framed-ip success(0) nodejs-nodejs compact framed-ip-ssl success(0) nodejs-nodejs json buffered-ip success(0) nodejs-nodejs json buffered-ip-ssl success(0) nodejs-nodejs json framed-ip success(0) nodejs-nodejs json framed-ip-ssl success(0) nodejs-cpp binary buffered-ip success(0) nodejs-cpp binary buffered-ip-ssl success(0) nodejs-cpp binary framed-ip success(0) nodejs-cpp binary framed-ip-ssl success(0) nodejs-cpp compact buffered-ip failure(1) nodejs-cpp compact buffered-ip-ssl failure(1) nodejs-cpp compact framed-ip success(0) nodejs-cpp compact framed-ip-ssl success(0) nodejs-cpp json buffered-ip success(0) nodejs-cpp json buffered-ip-ssl success(0) nodejs-cpp json framed-ip success(0) nodejs-cpp json framed-ip-ssl success(0) cpp-nodejs binary buffered-ip success(0) cpp-nodejs binary buffered-ip-ssl success(0) cpp-nodejs binary framed-ip success(0) cpp-nodejs binary framed-ip-ssl success(0) cpp-nodejs compact buffered-ip success(0) cpp-nodejs compact buffered-ip-ssl success(0) cpp-nodejs compact framed-ip success(0) cpp-nodejs compact framed-ip-ssl success(0) cpp-nodejs json buffered-ip success(0) cpp-nodejs json buffered-ip-ssl success(0) cpp-nodejs json framed-ip success(0) cpp-nodejs json framed-ip-ssl success(0) {noformat} > NodeJS decoding of I64 is inconsistent across protocols > ------------------------------------------------------- > > Key: THRIFT-3048 > URL: https://issues.apache.org/jira/browse/THRIFT-3048 > Project: Thrift > Issue Type: Bug > Components: Node.js - Library > Affects Versions: 0.9.2, 1.0 > Reporter: Will Demaine > Assignee: Randy Abernethy > > The NodeJS libraries decode i64 differently between protocols. The > {{TCompactProtocol}} returns a {{number}} whereas {{TBinaryProtocol}} and > {{TJSONProtocol}} return an {{object}} > Compact: > https://github.com/apache/thrift/blob/master/lib/nodejs/lib/thrift/compact_protocol.js#L815 > Binary: > https://github.com/apache/thrift/blob/master/lib/nodejs/lib/thrift/binary_protocol.js#L273 > JSON: > https://github.com/apache/thrift/blob/master/lib/nodejs/lib/thrift/json_protocol.js#L664 > This leads to a lack interoperability when switching between protocols: > {code} > service BTest { > bool testMethod ( > 1: string protocol > 2: i64 int64 > ); > } > {code} > {code:JavaScript} > var handlers = { > testMethod: function(desc, int64, callback) { > console.log(util.format('%s: %d, %s', desc, int64, typeof int64)); > callback(null, true); > } > }; > var startServer = function(callback){ > var serverOptions = { > services: { > '/thrift': { > handler: handlers, > processor: BTest, > protocol: thrift.TCompactProtocol, > transport: thrift.TBufferedTransport > }, > '/thrift.binary': { > handler: handlers, > processor: BTest, > protocol: thrift.TBinaryProtocol, > transport: thrift.TBufferedTransport > } > } > }; > this.server = thrift.createWebServer(serverOptions); > this.server.listen(9887, function serverCreated(){ > callback(); > }.bind(this)); > }; > {code} > Client side: > {code:JavaScript} > compactClient.testMethod('compact small', 123); > binaryClient.testMethod('binary small', 456); > compactClient.testMethod('compact', 4294967297); > binaryClient.testMethod('binary', 4294967297); > compactClient.testMethod('compact large', 3.602879702e16); > binaryClient.testMethod('binary large', 3.602879702e16); > {code} > Results (0.9.2 and 1.0-dev): > {code} > compact small: 123, number > binary small: 456, object > compact: 4294967297, number > binary: 4294967297, object > binary large: Infinity, object > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)