Good. I am now able to reproduce the bug here. the é of "André" placed in
last position is causing the problem. If somewhere else in the string it
does not.
Now why is the é causing a problem?
Nicolas.
Le samedi 13 avril 2013 08:40:55 UTC+1, Nicolas a écrit :
>
> After enquirying a bit more, I realized that the double double quotes is
> probably not the issue. I don't know why and when it occurs, but 1) it also
> occurs sometimes with FF, 2), my application does not break on the first
> double double quotes but later.
>
> Here is an example of where it breaks:
>
>
> [{""time"":""1365799173"",""raw"":""game_started"",""data"":{""match_id"":403525,""food_cost"":""4"",""opponent_language"":""fr"",""opponent_first_name"":""Andr?""startup_conditions"":[99,[99,10,7,5,0,0,0,0,0,0,0,0,0],[99,11,1,7,0,0,0,0,0,0,0,0,0]],""raw_id"":1,""page_counter"":9}},{""time"":""1365799173"",""raw"":""manager_infos"",""data"":{""match_id"":403525,""manager_infos"":{""die_rolled"":14},""raw_id"":2,""page_counter"":9}}]
>
>
> I think the "é" from "André" is most likely the problem. Look: it is here
> changed into ?. More importantly, the JSON is broken. Instead of having:
>
> ""opponent_first_name"":""Andr?"",""startup_conditions"":[99,[99,10,7,5,0,0,0,0,0,0,0,0,0],[99,11,1,7,0,0,0,0,0,0,0,0,0]]
> I receive this:
>
> ""opponent_first_name"":""Andr?""startup_conditions"":[99,[99,10,7,5,0,0,0,0,0,0,0,0,0],[99,11,1,7,0,0,0,0,0,0,0,0,0]]
>
> See: "","" was replaced by "" only.
>
> Any idea where this comes from? Server, Client?
>
> Thanks.
>
> Nicolas.
>
>
> Le samedi 13 avril 2013 07:33:39 UTC+1, Nicolas Guibert a écrit :
>>
>> I believe it is the default one. Long polling I guess. The one that opens
>> connection and close them if nothing happened in 25 seconds.
>>
>>
>>
>>
>> 2013/4/13 Louis Charette <[email protected]>
>>
>>> Which transport are you using?
>>>
>>> - Louis
>>>
>>> Le 2013-04-12 à 17:51, Nicolas <[email protected]> a écrit :
>>>
>>> Hi guys,
>>>
>>> I don't know if this is related to the above at all, but here is what I
>>> get in parseResponse sometimes (but not always) under IE8, IE9, IE10:
>>>
>>>
>>> raws:[{""time"":""1365798932"",""raw"":""IDENT"",""data"":{""user"":{""casttype"":""uni"",""pubid"":""aecee0a501f71ee7cc70fbec0e08934a""}}},{""time"":""1365798932"",""raw"":""SESSIONS"",""data"":{""sessions"":{""uniPipe"":""null""},""chl"":1}}]
>>>
>>> As you can see, there are double " everywhere.
>>>
>>> Although I have not logged what happens after that, it is clear to me
>>> that these double " are the reason why I never reach the onRaw function.
>>>
>>> So why on earth does APE sometimes get these double quotes under IE?
>>>
>>> Any clue?
>>>
>>> Nicolas.
>>>
>>>
>>>
>>> Le jeudi 14 mars 2013 15:48:35 UTC, Nicolas a écrit :
>>>>
>>>> Hi,
>>>>
>>>> I found a bug when sending a string that includes a single quote.
>>>>
>>>> To reproduce the bug, simply try sending a string that has a single
>>>> quote like this:
>>>>
>>>> pipe_user.sendRaw("name_raw",{**"msg"," ' ");
>>>>
>>>> Then you will get a bug on Core.js on the client side (I use mootools
>>>> client)
>>>>
>>>> Does anybody know why the bug happens? Is there an easy way to correct
>>>> this?
>>>>
>>>> See below for the exact line of the bug.
>>>>
>>>> Thanks.
>>>>
>>>> Nicolas.
>>>>
>>>>
>>>>
>>>>
>>>> /***
>>>> * Parse received data from Server
>>>> */
>>>> parseResponse: function(raws, callback) {
>>>> if (raws) {
>>>> if (this.status < 0 ) {
>>>> this.failCounter = 0;
>>>> this.status = 1;
>>>> this.startPoller();
>>>> this.fireEvent('apeReconnect')**;
>>>> }
>>>> }
>>>>
>>>> var check = false;
>>>> var chlCallback;//Callback on challenge
>>>>
>>>> if (raws) {
>>>> raws = JSON.parse(raws); <<<<<================= This is where the
>>>> error is raised. Why?
>>>> Uncaught SyntaxError: Unexpected token ' (repeated 4 times)
>>>> if (!raws){ // Something went wrong, json decode failed
>>>> this.check();
>>>> return;
>>>> }
>>>>
>>>> for (var i = 0; i < raws.length; i++){ //Read all raw
>>>> var raw = raws[i];
>>>>
>>>> if (callback && $type(callback) == 'function') {
>>>> callback.run(raw);
>>>> }
>>>>
>>>> this.callRaw(raw);
>>>>
>>>> //Last request is finished and it's not an error
>>>> if (!this.transport.running()) {
>>>> if (!raw.data.code || (raw.data.code != '006' && raw.data.code != '007'&&
>>>> raw.data.code != '005' && raw.data.code!= '001' && raw.data.code !=
>>>> '004' && raw.data.code != '003')) {
>>>> check = true;
>>>> }
>>>> } else {
>>>> //Invalidate check if something went wrong with other raw or a new
>>>> request have been launched
>>>> check = false;
>>>> }
>>>> }
>>>> } else if (!this.transport.running()) check = true; //No request
>>>> running, request didn't respond correct JSON, something went wrong
>>>> if (check) this.check();
>>>> },
>>>>
>>>
>>> --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "APE Project" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> For more options, visit this group at
>>> http://groups.google.com/group/ape-project?hl=en
>>> ---
>>> APE Project (Ajax Push Engine)
>>> Official website : http://www.ape-project.org/
>>> Git Hub : http://github.com/APE-Project/
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "APE Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>>
>>> --
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "APE Project" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> For more options, visit this group at
>>> http://groups.google.com/group/ape-project?hl=en
>>> ---
>>> APE Project (Ajax Push Engine)
>>> Official website : http://www.ape-project.org/
>>> Git Hub : http://github.com/APE-Project/
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "APE Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>
>>
>> --
>>
>>
>> <http://www.happymeeple.com>
>>
>> Nicolas Guibert
>>
>> Games in Mind Ltd
>>
>> Managing director
>>
>> 7 Spencer Walk
>>
>> Tel: +44 (0)207 435 0315
>>
>> UK Mobile: +44 (0)7638 657 537
>>
>> French Mobile: +33 (0)7 53 17 20 13
>>
>> Email: [email protected]
>>
>>
--
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/
---
You received this message because you are subscribed to the Google Groups "APE
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.