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

Roger Meier edited comment on THRIFT-815 at 7/10/10 5:35 PM:
-------------------------------------------------------------

This patch fixes wrong order on wire:

detected with the Unit Test provided above and Firebug
{code:JavaScript}
var list = new Array(1,2,3)
    test("List", function() {
      ok(client.testList(list), list);
    });
{code} 

Wire:
{code}
out: [1,"testList",1,0,{"1":{"lst":["i32",3,3,2,1]}}]
in:   [1,"testList",2,0,{"0":{"lst":["i32",3,3,2,1]}}]
{code}

With that patch:
{code}
out: [1,"testList",1,0,{"1":{"lst":["i32",3,1,2,3]}}]
in:   [1,"testList",2,0,{"0":{"lst":["i32",3,1,2,3]}}]
{code}


      was (Author: roger.meier):
    This patch fixes wrong order on wire:

detected with the Unit Test provided above and Firebug
{code:JavaScript}
var list = new Array(1,2,3)
    test("List", function() {
      ok(client.testList(list), list);
    });
{code} 

Wire:
out: [1,"testList",1,0,{"1":{"lst":["i32",3,3,2,1]}}]
in:   [1,"testList",2,0,{"0":{"lst":["i32",3,3,2,1]}}]

With that patch:
out: [1,"testList",1,0,{"1":{"lst":["i32",3,1,2,3]}}]
in:   [1,"testList",2,0,{"0":{"lst":["i32",3,1,2,3]}}]


  
> Deserialization of lists is critically broken.
> ----------------------------------------------
>
>                 Key: THRIFT-815
>                 URL: https://issues.apache.org/jira/browse/THRIFT-815
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (JavaScript)
>    Affects Versions: 0.4
>            Reporter: Jordan
>            Assignee: T Jake Luciani
>            Priority: Critical
>             Fix For: 0.4
>
>         Attachments: 813-1.patch, test.html, THRIFT-815_thrift.js.patch
>
>
> Edit the test code that comes with the js language target:
>   var list = [1,2,3]; 
>   var ret = client.testList(list);
>   debugger;
> ret comes back as [3,3,3] when it should be echoed back as [1,2,3]
> The test case never caught this because it only verified the size, and not 
> the contents of the returned array. 
> I cannot find an immediate workaround, but I will try wrapping it in a dummy 
> type like ListServiceResponse. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to