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

JavaScript client assumes a message being written

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.2
    • 0.9.3
    • JavaScript - Library
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: