You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Henrique Mendonca (JIRA)" <ji...@apache.org> on 2011/07/15 18:48:59 UTC

[jira] [Created] (THRIFT-1238) Thrift JS client cannot read map of structures

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


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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Mars Hsu (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247202#comment-13247202 ] 

Mars Hsu commented on THRIFT-1238:
----------------------------------

I think this issus still not fixed. Here is a example

enum AutoAttribute {
  POWER = 0,
  MANIPULATE = 1,
  APPEARANCE = 2,
  DURABILITY = 3,
}

struct UserAutoDTO {
  1: required string autoId,
  2: required string autoName,
  3: required string color,
  4: required map<AutoAttribute, double> currentAttribute,
}

the client is scala(java), and service side is nodejs.

[2012-04-05 08:02:41.547] [INFO] console - input.rstack:
[2012-04-05 08:02:41.548] [INFO] console - undefined
[2012-04-05 08:02:41.549] [INFO] console - input.rpos:
[2012-04-05 08:02:41.549] [INFO] console - undefined

/web/node_modules/thrift/lib/thrift/server.js:50
          throw e;
                ^
TypeError: Cannot read property 'length' of undefined
    at Object.read (/web/gen-nodejs/auto_types.js:1670:29)


                
> 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

        

[jira] [Resolved] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Henrique Mendonca (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca resolved THRIFT-1238.
---------------------------------------

    Resolution: Fixed

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ 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

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Ryan Phillips (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144273#comment-13144273 ] 

Ryan Phillips commented on THRIFT-1238:
---------------------------------------

Hi!

I'm testing thrift 0.8.0 with our code base and came across an issue using javascript and node-thrift.

Our generated thrift code runs with this error: Uncaught TypeError: Cannot read property 'length' of undefined.

The generated code includes:
  if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {
    input.rstack.pop();
  }

It appears this patch breaks binary protocol compatibility, but I want to run the issue by everyone, since I'm new with thrift.

Thanks,
Ryan
                
> 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

        

[jira] [Updated] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Henrique Mendonca (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca updated THRIFT-1238:
--------------------------------------

    Attachment: THRIFT-1238-qunit-insanity.patch

> 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
>         Attachments: 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066170#comment-13066170 ] 

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

I committed the testcase, thanks Henrique!

> 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
>         Attachments: 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101063#comment-13101063 ] 

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

Thanks Henrique, committed!

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13070053#comment-13070053 ] 

Hudson commented on THRIFT-1238:
--------------------------------

Integrated in Thrift #193 (See [https://builds.apache.org/job/Thrift/193/])
    THRIFT-1238 Thrift JS client cannot read map of structures(TestCase)
Patch: Henrique Mendonca

roger : http://svn.apache.org/viewvc/?view=rev&rev=1147301
Files : 
* /thrift/trunk/lib/js/test/build.xml
* /thrift/trunk/lib/js/test/test.html
* /thrift/trunk/lib/java/test/org/apache/thrift/server/ServerTestBase.java


> 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
>         Attachments: 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier updated THRIFT-1238:
--------------------------------

    Fix Version/s: 0.7

> 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.7
>
>         Attachments: 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Henrique Mendonca (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henrique Mendonca updated THRIFT-1238:
--------------------------------------

    Attachment: THRIFT-1238-fix-maps+qunit.patch

finally: THRIFT-1238-fix-maps+qunit.patch
Although I still see a weird behavior with lis<map<str, str>>, it should fix most of the problems with maps deserialization.

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Henrique Mendonca (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13247210#comment-13247210 ] 

Henrique Mendonca commented on THRIFT-1238:
-------------------------------------------

Hi Mars Hsu
This ticket was created for the "browser" JavaScript thrift. Would you mind to create a new issue for this?
Ryan could be right and this could actually be caused by my patch but I'm not very sure if it was working before either...
I'm pretty busy at the moment but I'll be glad to test a patch if you have one :D

Thanks,
Henrique
                
> 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

        

[jira] [Commented] (THRIFT-1238) Thrift JS client cannot read map of structures

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101073#comment-13101073 ] 

Hudson commented on THRIFT-1238:
--------------------------------

Integrated in Thrift #256 (See [https://builds.apache.org/job/Thrift/256/])
    THRIFT-1238 Thrift JS client cannot read map of structures
Patch: Henrique Mendonca

roger : http://svn.apache.org/viewvc/?view=rev&rev=1167032
Files : 
* /thrift/trunk/compiler/cpp/src/generate/t_js_generator.cc
* /thrift/trunk/lib/js/test/build.xml
* /thrift/trunk/lib/js/test/test.js


> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira