[ 
https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144315#comment-13144315
 ] 

Roger Meier commented on THRIFT-1238:
-------------------------------------

Hi Ryan

The JavaScript implementation does only support json protocol. The js test 
suite does cover most of the features.

node js does not have a testsuite, see THRIFT-1134 and it does not use the same 
code base as we have within thrift.js
The starting point for node.js bug fixes are the unit tests.

A possible approach might be to introduce require.js on js side to share the 
same code basis for node and regular javascript.

-roger
                
> Thrift JS client cannot read map of structures
> ----------------------------------------------
>
>                 Key: THRIFT-1238
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1238
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Compiler, JavaScript - Library
>    Affects Versions: 0.6.1
>            Reporter: Henrique Mendonca
>              Labels: javascript
>             Fix For: 0.8
>
>         Attachments: THRIFT-1238-fix-maps+qunit.patch, 
> THRIFT-1238-qunit-insanity.patch
>
>
> Apparently we have a problem reading map of structures, only one item is been 
> read and the other come as undefined in the result map on the client side.
> I was having this with some complex maps and notice that the test case 
> 'testInsanity' was quite similar to my case but was actually been tested at 
> all. Then checking its result I could see that's it actually a general 
> problem.
> The server sends 2 elements:
> {code}
> {
>     "1":{
>         "3":{
>             "userMap":{
>                 "8":8,
>                 "5":5
>             },
>             "xtructs":[{
>                     "string_thing":"Goodbye4",
>                     "byte_thing":4,
>                     "i32_thing":4,
>                     "i64_thing":4
>                 },
>                 {
>                     "string_thing":"Hello2",
>                     "byte_thing":2,
>                     "i32_thing":2,
>                     "i64_thing":2
>                 }
>             ]
>         },
>         "2":{
>             "userMap":{
>                 "8":8,
>                 "5":5
>             },
>             "xtructs":[{
>                     "string_thing":"Goodbye4",
>                     "byte_thing":4,
>                     "i32_thing":4,
>                     "i64_thing":4
>                 },
>                 {
>                     "string_thing":"Hello2",
>                     "byte_thing":2,
>                     "i32_thing":2,
>                     "i64_thing":2
>                 }
>             ]
>         }
>     },
>     "2":{
>         "6":{
>             "userMap":null,
>             "xtructs":null
>         }
>     }
> }
> {code}
> but we can only read 1:
> {code}
> {
>     "1":{
>         "2":{
>             "userMap":{
>                 "8":8,
>                 "5":5
>             },
>             "xtructs":[{
>                     "string_thing":"Goodbye4",
>                     "byte_thing":4,
>                     "i32_thing":4,
>                     "i64_thing":4
>                 },
>                 {
>                     "string_thing":"Hello2",
>                     "byte_thing":2,
>                     "i32_thing":2,
>                     "i64_thing":2
>                 }
>             ]
>         },
>         "undefined":{
>             "userMap":null,
>             "xtructs":null
>         }
>     },
>     "2":{
>         "6":{
>             "userMap":null,
>             "xtructs":null
>         }
>     }
> }
> {code}
> on my code it also happens with 3 or more structures, only the first one is 
> read, the second is "undefined" and the rest is gone!
> ps.: I'm submitting the patch for the unit test. I had a quick look on the 
> code but could find anything yet and won't have time in the next weeks...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to