Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    unicode character breaking RPCManager's fetch response parsing.

    We are using DMI to request data generated by a backend API call to be populated into our grid. For one of our data sets we have found that the data for one of the row's fields has a unicode character causing the fetch to fail.

    I have copied the bad data value below;

    ==== string below contains the unicode character ====
    also new

    ==========================================

    getBytes() for the var holding the above text returns;

    [97,108,115,111,32,110,101,119,-30,-128,-88]

    Are there any configuration settings for the SmartGWT server framework that we need to set to allow this data to flow through to the grid or be escaped?

    Or is there a recommended approach to handling this situation?


    1. SmartClient Version: v8.3p_2013-02-08/PowerEdition Deployment (built 2013-02-08)

    2. not browser specific

    4. 05:49:23.009:XRP5:WARN:RPCManager:Error evaling structured RPC response: Unexpected token ILLEGAL response text: [{data:[{newer_stuff:"foo",headline_text:"foo",driverID:"25016",status_newer_stuff:"0",status_headline_text:"0",record_status:"ACTIVE"},{category:"electronics",newer_stuff:"foo",col1:"also new
",driverID:"39199",isInherited_newer_stuff:"YES",headline_txt:"this is new",status_newer_stuff:"0",status_col1:"1",status_headline_txt:"0",record_status:"ACTIVE",ancestor_newer_stuff:"{default}",record_changed:"record_changed"},{category:"mens",newer_stuff:"bar",driverID:"25047",status_newer_stuff:"0",record_status:"ACTIVE"},{newer_stuff:"hello world",driverID:"36683",promotion:"420",status_newer_stuff:"0",record_status:"ACTIVE"}],invalidateCache:false,isDSResponse:true,operationType:"fetch",queueStatus:0,status:0}]
    05:49:23.009:XRP5:WARN:ResultSet:isc_ResultSet_1 (created by: Grid_Grid):Bad data returned, ignoring: "//isc_RPCResponseStart-->[{data:[{newer_stuff:"foo",headline_text:"foo",driverID:"25016",status_newer_stuff:"0",status_headline_text:"0",record_status:"ACTIVE"},{category:"electronics",newer_stuff:"foo",col1:"also new
",driverID:"39199",isInherited_newer_stuff:"YES",headline_txt:"this is new",status_newer_stuff:"0",status_col1:"1",status_headline_txt:"0",record_status:"ACTIVE",ancestor_newer_stuff:"{default}",record_changed:"record_changed"},{category:"mens",newer_stuff:"bar",driverID:"25047",status_newer_stuff:"0",record_status:"ACTIVE"},{newer_stuff:"hello world",driverID:"36683",promotion:"420",status_newer_stuff:"0",record_status:"ACTIVE"}],invalidateCache:false,isDSResponse:true,operationType:"fetch",queueStatus:0,status:0}]//isc_RPCResponseEnd"

    #2
    FYI.. I've now added code to the server side that escapes the character and allows the DSResponse to be evaluated/parsed correctly.

    Comment


      #3
      So just to clarify - there's no bug in SmartGWT here. RPCManager response "parsing" in this case is actually JavaScript eval(), so breaking it indicates that through some encoding issue, you were actually delivering bad bytes to the browser, not a Unicode character valid as a data value.

      Comment


        #4
        yes, the bad data delivered to the browser was causing the RPCManager's eval to fail, it wasn't a SmartGWT bug/issue.

        The end result was that our grid was not being populated, and the "Loading Data" spinner was stuck continuously spinning. There was no error displayed/prompted on the client's browser, but that may be due to our handling..

        Comment

        Working...
        X