Closed stannedelchev closed 8 years ago
Any news regarding this issue? It's a blocker for history retrieval functionality in the Android demo app.
No, I've not had a chance yet but will asap
@stannedelchev we're doing our best to address this but just not had time. I'm hoping to get some help to address this in the next few days...
@stannedelchev can you test now as our Android work is merged in master
. If this is still an issue, please tell us, and we'll prioritise
@mattheworiordan I'll test it out on master
today.
@stannedelchev I tested your code with ably-java v0.8.1
Although cause of exception is a bit little different since you are using an older version, I believe the reason is the same. We are receiving 82 a6 61 63 74 69 6f 6e 01 a5 63 6f 75 6e 74 01
messagepack message on the client. That translates to {"action":1,"count":1}
. Since we are missing some required parameters (msgSerial
in my case) by the client-side, that is throwing NPE.
@mattheworiordan How would you recommend us to handle this message?
Below you can find my NPE log
01-12 08:35:03.338 1865-1865/com.experiment.ablychannelhistorydemo I/System.out: (INFO): io.ably.lib.realtime.AblyRealtime: started
01-12 08:35:03.341 1865-1865/com.experiment.ablychannelhistorydemo I/System.out: (INFO): Auth(): using token auth with client-side signing
01-12 08:35:03.413 1865-1865/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.transport.ConnectionManager: requestState(): requesting connecting; id = null
01-12 08:35:03.414 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.transport.ConnectionManager: notifyState(): notifying connecting; id = null
01-12 08:35:03.415 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): TokenAuth.authorise():
01-12 08:35:03.415 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): TokenAuth.authorise(): requesting new token
01-12 08:35:03.415 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): Auth.requestToken(): using token auth with client-side signing
01-12 08:35:03.420 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): Auth.getTokenRequest(): generated signed request
01-12 08:35:03.422 1865-1921/com.experiment.ablychannelhistorydemo D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
[ 01-12 08:35:03.436 1865: 1865 D/ ]
HostConnection::get() New Host Connection established 0xf3fc5a80, tid 1865
01-12 08:35:03.443 1865-1865/com.experiment.ablychannelhistorydemo D/Atlas: Validating map...
01-12 08:35:03.501 1865-1921/com.experiment.ablychannelhistorydemo D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
01-12 08:35:03.502 1865-1921/com.experiment.ablychannelhistorydemo D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
01-12 08:35:03.510 1865-1921/com.experiment.ablychannelhistorydemo D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
[ 01-12 08:35:03.515 1865: 1921 D/ ]
HostConnection::get() New Host Connection established 0xeec394d0, tid 1921
01-12 08:35:03.538 1865-1921/com.experiment.ablychannelhistorydemo I/OpenGLRenderer: Initialized EGL, version 1.4
01-12 08:35:03.592 1865-1921/com.experiment.ablychannelhistorydemo D/OpenGLRenderer: Enabling debug mode 0
01-12 08:35:03.607 1865-1921/com.experiment.ablychannelhistorydemo W/EGL_emulation: eglSurfaceAttrib not implemented
01-12 08:35:03.607 1865-1921/com.experiment.ablychannelhistorydemo W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xeed48700, error=EGL_SUCCESS
01-12 08:35:05.437 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): TokenAuth.setTokenDetails():
01-12 08:35:05.437 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): TokenAuth.getTokenDetails():
01-12 08:35:05.438 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.transport.ConnectionManager: setState(): setting connecting
01-12 08:35:05.439 1865-1920/com.experiment.ablychannelhistorydemo V/ABLY CONNECTION CHANGE: connecting
01-12 08:35:06.130 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: Unexpected field: serverId
01-12 08:35:06.130 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.transport.ConnectionManager: notifyState(): notifying connected; id = xoyyX2CeAQmA6Q6O-411e4300e
01-12 08:35:06.130 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.transport.ConnectionManager: setState(): setting connected
01-12 08:35:06.131 1865-1920/com.experiment.ablychannelhistorydemo V/ABLY CONNECTION CHANGE: connected
01-12 08:35:06.133 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: RealtimeChannel(); channel = mobile:chat
01-12 08:35:06.134 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: attach(); channel = mobile:chat
01-12 08:35:06.134 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: setState(): channel = mobile:chat; setting attaching
01-12 08:35:06.135 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: subscribe(); channel = mobile:chat
01-12 08:35:06.135 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: attach(); channel = mobile:chat
01-12 08:35:06.590 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): TokenAuth.authorise():
01-12 08:35:06.590 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): TokenAuth.authorise(): using cached token; expires = 1452609305169
01-12 08:35:06.590 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (INFO): TokenAuth.getEncodedToken():
01-12 08:35:08.249 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: setAttached(); channel = mobile:chat
01-12 08:35:08.249 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: setState(): channel = mobile:chat; setting attached
01-12 08:35:08.249 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: sendQueuedMessages()
01-12 08:35:08.250 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: sendQueuedMessages()
01-12 08:35:08.302 1865-1920/com.experiment.ablychannelhistorydemo V/ABLY TEST: History results: 0
01-12 08:35:08.302 1865-1920/com.experiment.ablychannelhistorydemo I/System.out: (VERBOSE): io.ably.lib.realtime.Channel: sync(); channel = mobile:chat
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: (ERROR): io.ably.lib.transport.WebSocketTransport: Unexpected exception in WsClient
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at io.ably.lib.transport.ConnectionManager.onAck(ConnectionManager.java:342)
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at io.ably.lib.transport.ConnectionManager.onMessage(ConnectionManager.java:287)
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at io.ably.lib.transport.WebSocketTransport$WsClient.onMessage(WebSocketTransport.java:148)
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:253)
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:381)
01-12 09:19:14.074 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:158)
01-12 09:19:14.075 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:185)
01-12 09:19:14.075 1865-1956/com.experiment.ablychannelhistorydemo I/System.out: at java.lang.Thread.run(Thread.java:818)
How would you recommend us to handle this message?
You should not crash but there isn't anything else really you should do, because it should never be possible for you to receive this message. I will have a look at why this is being sent.
You should not crash
OK. I will handle the exception.
Thanks @gokhanbarisaker for identifying this, looks like we have a bug in the realtime system. I have raised an issue that will hopefully be fixed shortly by @paddybyers
ably-android.jar
in projectchannel.history()
on line 61:io.ably.types.AblyException: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.security.Principal.getName()' on a null object reference
Here's the full log:
FYI @mattheworiordan @paddybyers