Server responds with json decode failure for fat unicode characters

RESOLVED FIXED in 0.6

Status

()

RESOLVED FIXED
9 years ago
2 months ago

People

(Reporter: Mardak, Assigned: Mardak)

Tracking

unspecified
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Not sure where we're failing yet... but when we try uploading this client record:

[{"payload":"{\"name\":\"Cú Caoimhín test\",\"type\":\"desktop\"}","id":"8bf246c0-20be-b74c-90b9-9eba9a20b995"}]

the server responds with 6.

We call nsIStringInputStream.setData but apparently the first arg is a "string", so it only takes ASCII data.
http://mxr.mozilla.org/mozilla-central/source/xpcom/io/nsIStringStream.idl#69

We'll need to encode the client name before sending and decode on receive.
(Assignee)

Comment 1

9 years ago
Created attachment 391958 [details] [diff] [review]
v1

*** test pending
Test that serializing client records results in uploadable ascii
Make sure we have the expected record
Checking for all ASCII: {"payload":"{\"name\":\"w%C3%A9%C3%A4v%C3%AA\"}","id":"ascii"}
Checking asciiness of ' { ' =  123
Checking asciiness of ' " ' =  34
Checking asciiness of ' p ' =  112
Checking asciiness of ' a ' =  97
Checking asciiness of ' y ' =  121
Checking asciiness of ' l ' =  108
Checking asciiness of ' o ' =  111
Checking asciiness of ' a ' =  97
Checking asciiness of ' d ' =  100
Checking asciiness of ' " ' =  34
Checking asciiness of ' : ' =  58
Checking asciiness of ' " ' =  34
Checking asciiness of ' { ' =  123
Checking asciiness of ' \ ' =  92
Checking asciiness of ' " ' =  34
Checking asciiness of ' n ' =  110
Checking asciiness of ' a ' =  97
Checking asciiness of ' m ' =  109
Checking asciiness of ' e ' =  101
Checking asciiness of ' \ ' =  92
Checking asciiness of ' " ' =  34
Checking asciiness of ' : ' =  58
Checking asciiness of ' \ ' =  92
Checking asciiness of ' " ' =  34
Checking asciiness of ' w ' =  119
Checking asciiness of ' % ' =  37
Checking asciiness of ' C ' =  67
Checking asciiness of ' 3 ' =  51
Checking asciiness of ' % ' =  37
Checking asciiness of ' A ' =  65
Checking asciiness of ' 9 ' =  57
Checking asciiness of ' % ' =  37
Checking asciiness of ' C ' =  67
Checking asciiness of ' 3 ' =  51
Checking asciiness of ' % ' =  37
Checking asciiness of ' A ' =  65
Checking asciiness of ' 4 ' =  52
Checking asciiness of ' v ' =  118
Checking asciiness of ' % ' =  37
Checking asciiness of ' C ' =  67
Checking asciiness of ' 3 ' =  51
Checking asciiness of ' % ' =  37
Checking asciiness of ' A ' =  65
Checking asciiness of ' A ' =  65
Checking asciiness of ' \ ' =  92
Checking asciiness of ' " ' =  34
Checking asciiness of ' } ' =  125
Checking asciiness of ' " ' =  34
Checking asciiness of ' , ' =  44
Checking asciiness of ' " ' =  34
Checking asciiness of ' i ' =  105
Checking asciiness of ' d ' =  100
Checking asciiness of ' " ' =  34
Checking asciiness of ' : ' =  58
Checking asciiness of ' " ' =  34
Checking asciiness of ' a ' =  97
Checking asciiness of ' s ' =  115
Checking asciiness of ' c ' =  99
Checking asciiness of ' i ' =  105
Checking asciiness of ' i ' =  105
Checking asciiness of ' " ' =  34
Checking asciiness of ' } ' =  125
Processed 62 characters out of 62
Making sure the record still looks like it did before
Sanity check that creating the record also gives the same
*** test finished
*** exiting
*** PASS ***
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #391958 - Flags: review?(thunder)
(Assignee)

Updated

9 years ago
Attachment #391958 - Flags: review?(thunder)
(Assignee)

Comment 2

9 years ago
Somehow I didn't update this bug earlier before pre1.. ??

http://hg.mozilla.org/labs/weave/rev/b0ef1388d24a
Make sure we generate ASCII data for upload by escaping on serialize and unescaping on deserialize. Test to make sure serialized data is ASCII and the original records aren't modified by serialize.
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.6
(Assignee)

Updated

9 years ago
Duplicate of this bug: 501899
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.