Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2923

JavaScript client assumes a message being written

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.2
    • Fix Version/s: 0.9.3
    • Component/s: JavaScript - Library
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      I am working on a solution which uses Thrift directly, without embedded RPC framework, it's sending messages via UDP. Currently being integrated into Chrome Extension and I found a bug when doing the following:

      var transport = new Thrift.TWebSocketTransport("http://dummy");
      var protocol  = new Thrift.Protocol( transport );
      digest.write( protocol );
      

      The error is:

      Cannot read property 'push' of undefined.
      

      The reason for this behaviour is:

      digest.write calls protocol.writeStructBegin which uses this.tpos.push(this.tstack.length) in https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L778 but tpos and tstack aren't defined unless writeMessageBegin is called in https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L751.

      Expected behaviour:

      tstack and tpos should be defined in the Protocol "constructor", here: https://github.com/apache/thrift/blob/master/lib/js/src/thrift.js#L687.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              radekg Radoslaw Gruchalski
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: