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

JS Deserialization of lists of lists is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.9.3
    • None
    • JavaScript - Library
    • None
    • Patch Available
    • Patch, Important

    Description

      struct QueryResult {
      1: required list<list<string>> rows;
      }
      service QueryService{
      QueryResult query();
      }

      Using TJSONProtocol the list<list<string>> is transmitted correctly but deserialized wrong. Only the first sublist will contain the correct string values the second, third and so on will be empty. The error is a combination of readListBegin, readListEnd and readString (in thrift.js) which somehow interacts wrongly with the internal rstack when lists are included in lists.

      As a temporary solution until the deserialization is fixed I advice others to create an intermediate struct which contains the sublists.

      Attachments

        1. THRIFT-3669-0.10.0.pach
          6 kB
          Jared Szechy
        2. thrift.js
          44 kB
          Christian Bürckert
        3. 0001-Fixed-THRIFT-3669.patch
          26 kB
          Christian Bürckert

        Activity

          People

            Unassigned Unassigned
            Christian.Buerckert Christian Bürckert
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: