ericmckean / wave-protocol

Automatically exported from code.google.com/p/wave-protocol
0 stars 0 forks source link

Error in JSON parsing leaves Wavelet in wrong state #236

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create new Wave
2. Start typing, for example "Selvä, kokeile"

What is the expected output? What do you see instead?

One should have a Wave with text "Selvä, kokeile". But instead, after saving 
you're left with "Selv". There's no indication to user that there's been an 
error processing the Wavelet. Instead, everything the user has done after the 
first non-US-ASCII character is lost in this case.

What changeset or version are you using? On what operating system?

Chrome 11.0.686.3, Wave-In-a-Box checked out 4.3.2011 (I don't know where to 
check Mercurial's revision). WIAB running on Linux, Chrome in Windows 7.

Please provide any additional information below.

The logs show Exception being thrown from "ä". Could this be related to issue 
#32 when it comes to not accepting normal unicode characters? Or is this 
separate bug? (I'm reporting the fact that user doesn't get input from error).

Session[obVd7G7hDH4reibSKmVx]: onMessage: {"version":1, "sequenceNumber":28, 
"messageType":"ProtocolSubmitRequest", 
"messageJson":"{\"1\":\"local/w+y3oY2wdh0mA/~/conv+root\",\"2\":{\"1\":{\"1\":16
,\"2\":\"PcgEinL+F7LPUlIDlOg96GJWtxc=\"},\"2\":\"michael@local\",\"3\":[{\"3\":{
\"1\":\"b+y3oY2wdh0mB\",\"2\":{\"1\":[{\"5\":7},{\"2\":\"ä\"},{\"5\":1}]}}}]},\
"3\":\"ch2\"}"}
org.codehaus.jackson.JsonParseException: Invalid UTF-8 middle byte 0x22
 at [Source: java.io.ByteArrayInputStream@3ea4be02; line: 1, column: 170]
        at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:943)
        at org.codehaus.jackson.impl.JsonParserBase._reportError(JsonParserBase.java:632)
        at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidOther(Utf8StreamParser.java:1673)
        at org.codehaus.jackson.impl.Utf8StreamParser._reportInvalidOther(Utf8StreamParser.java:1680)
        at org.codehaus.jackson.impl.Utf8StreamParser._decodeUtf8_3fast(Utf8StreamParser.java:1503)
        at org.codehaus.jackson.impl.Utf8StreamParser._finishString(Utf8StreamParser.java:964)
        at org.codehaus.jackson.impl.JsonParserBase.getText(JsonParserBase.java:364)
        at com.dyuproject.protostuff.json.InlineValue$6.readFrom(InlineValue.java:149)
        at com.dyuproject.protostuff.json.InlineValue$6.readFrom(InlineValue.java:146)
        at com.dyuproject.protostuff.json.ReflectionConvertor$InlineField.readFrom(ReflectionConvertor.java:341)
        at com.dyuproject.protostuff.json.ReflectionConvertor.mergeFrom(ReflectionConvertor.java:102)
        at com.dyuproject.protostuff.json.ReflectionConvertor.parseFrom(ReflectionConvertor.java:80)
        at com.dyuproject.protostuff.json.ReflectionConvertor$RepeatedMessageField.readFrom(ReflectionConvertor.java:253)
        at com.dyuproject.protostuff.json.ReflectionConvertor.mergeFrom(ReflectionConvertor.java:102)
        at com.dyuproject.protostuff.json.ReflectionConvertor.parseFrom(ReflectionConvertor.java:80)
        at com.dyuproject.protostuff.json.ReflectionConvertor$MessageField.readFrom(ReflectionConvertor.java:163)
        at com.dyuproject.protostuff.json.ReflectionConvertor.mergeFrom(ReflectionConvertor.java:102)
        at com.dyuproject.protostuff.json.ReflectionConvertor.parseFrom(ReflectionConvertor.java:80)
        at com.dyuproject.protostuff.json.ReflectionConvertor$MessageField.readFrom(ReflectionConvertor.java:163)
        at com.dyuproject.protostuff.json.ReflectionConvertor.mergeFrom(ReflectionConvertor.java:102)
        at com.dyuproject.protostuff.json.ReflectionConvertor.parseFrom(ReflectionConvertor.java:80)
        at com.dyuproject.protostuff.json.ReflectionConvertor$RepeatedMessageField.readFrom(ReflectionConvertor.java:253)
        at com.dyuproject.protostuff.json.ReflectionConvertor.mergeFrom(ReflectionConvertor.java:102)
        at com.dyuproject.protostuff.json.ReflectionConvertor.parseFrom(ReflectionConvertor.java:80)
        at com.dyuproject.protostuff.json.ReflectionConvertor$MessageField.readFrom(ReflectionConvertor.java:163)
        at com.dyuproject.protostuff.json.ReflectionConvertor.mergeFrom(ReflectionConvertor.java:102)
        at com.dyuproject.protostuff.json.ReflectionConvertor.parseFrom(ReflectionConvertor.java:80)
        at com.dyuproject.protostuff.json.ProtobufJSON.parseFrom(ProtobufJSON.java:126)
        at com.dyuproject.protostuff.json.ProtobufJSON.parseFrom(ProtobufJSON.java:86)
        at org.waveprotocol.box.server.rpc.WebSocketChannel.handleMessageString(WebSocketChannel.java:95)
        at org.waveprotocol.box.server.rpc.SocketIOServerChannel.onMessage(SocketIOServerChannel.java:70)
        at com.glines.socketio.server.SocketIOSessionManager$SessionImpl.onMessage(SocketIOSessionManager.java:300)
        at com.glines.socketio.server.SocketIOSessionManager$SessionImpl.onMessage(SocketIOSessionManager.java:218)
        at com.glines.socketio.server.transport.WebSocketTransport$SessionWrapper.onMessage(WebSocketTransport.java:106)
        at org.eclipse.jetty.websocket.WebSocketConnection$1.onFrame(WebSocketConnection.java:58)
        at org.eclipse.jetty.websocket.WebSocketParser.parseNext(WebSocketParser.java:140)
        at org.eclipse.jetty.websocket.WebSocketConnection.handle(WebSocketConnection.java:177)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:506)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)
        at java.lang.Thread.run(Thread.java:636)

Original issue reported on code.google.com by bur...@gmail.com on 5 Mar 2011 at 11:05

GoogleCodeExporter commented 9 years ago
I suspect this is related to bug 234.

My hunch is that the various encoders in the serialization stack are not in 
agreement about whether unicode characters are encoded using UTF-8 or UTF-16.

Note that we're trying to move to a different stack anyway (PST instead of 
protostuff), which may or may not have the same problem.

Original comment by hearn...@google.com on 7 Mar 2011 at 4:13

GoogleCodeExporter commented 9 years ago
Yes, it is the same issue. Is it possible to merge them?

Original comment by vega113 on 14 Mar 2011 at 1:09

GoogleCodeExporter commented 9 years ago
fixed

Original comment by vega113 on 3 Apr 2011 at 8:21