Seems to be the same issue as #32 but in a different scenario.
Steps to reproduce:
Login with a BaasBox User.
Restart BaasBox server.
Go to somewhere in the app where BaasBox server is called and it crashes with ProtocolException.
After crashing the app can be restarted and it works fine.
If Social Login is used then it doesn't crash as in this case the session token expires with restart and BaasInvalidSessionException is thrown, which can be handled correctly.
5.0.1 Lollipop.
java.lang.Error: Got a protocol exception while setting http method
at com.baasbox.android.HttpUrlConnectionClient.setupConnectionForRequest(HttpUrlConnectionClient.java:244)
at com.baasbox.android.HttpUrlConnectionClient.execute(HttpUrlConnectionClient.java:158)
at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:151)
at com.baasbox.android.NetworkTask.parseResponse(NetworkTask.java:74)
at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:152)
at com.baasbox.android.impl.Task.execute(Task.java:189)
at com.baasbox.android.impl.Dispatcher$Worker.run(Dispatcher.java:170)
Caused by: java.net.ProtocolException: content-length promised 17 bytes, but received 0
at com.android.okhttp.internal.http.RetryableSink.close(RetryableSink.java:50)
at com.android.okio.RealBufferedSink.close(RealBufferedSink.java:174)
at com.android.okio.RealBufferedSink$1.close(RealBufferedSink.java:142)
at com.baasbox.android.HttpUrlConnectionClient.copyStream(HttpUrlConnectionClient.java:266)
at com.baasbox.android.HttpUrlConnectionClient.addBody(HttpUrlConnectionClient.java:252)
at com.baasbox.android.HttpUrlConnectionClient.setupConnectionForRequest(HttpUrlConnectionClient.java:228)
at com.baasbox.android.HttpUrlConnectionClient.execute(HttpUrlConnectionClient.java:158)
at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:151)
at com.baasbox.android.NetworkTask.parseResponse(NetworkTask.java:74)
at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:152)
at com.baasbox.android.impl.Task.execute(Task.java:189)
at com.baasbox.android.impl.Dispatcher$Worker.run(Dispatcher.java:170)
Seems to be the same issue as #32 but in a different scenario.
Steps to reproduce:
Login with a BaasBox User. Restart BaasBox server. Go to somewhere in the app where BaasBox server is called and it crashes with ProtocolException.
After crashing the app can be restarted and it works fine.
If Social Login is used then it doesn't crash as in this case the session token expires with restart and BaasInvalidSessionException is thrown, which can be handled correctly.
5.0.1 Lollipop.
java.lang.Error: Got a protocol exception while setting http method at com.baasbox.android.HttpUrlConnectionClient.setupConnectionForRequest(HttpUrlConnectionClient.java:244) at com.baasbox.android.HttpUrlConnectionClient.execute(HttpUrlConnectionClient.java:158) at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:151) at com.baasbox.android.NetworkTask.parseResponse(NetworkTask.java:74) at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:152) at com.baasbox.android.impl.Task.execute(Task.java:189) at com.baasbox.android.impl.Dispatcher$Worker.run(Dispatcher.java:170) Caused by: java.net.ProtocolException: content-length promised 17 bytes, but received 0 at com.android.okhttp.internal.http.RetryableSink.close(RetryableSink.java:50) at com.android.okio.RealBufferedSink.close(RealBufferedSink.java:174) at com.android.okio.RealBufferedSink$1.close(RealBufferedSink.java:142) at com.baasbox.android.HttpUrlConnectionClient.copyStream(HttpUrlConnectionClient.java:266) at com.baasbox.android.HttpUrlConnectionClient.addBody(HttpUrlConnectionClient.java:252) at com.baasbox.android.HttpUrlConnectionClient.setupConnectionForRequest(HttpUrlConnectionClient.java:228) at com.baasbox.android.HttpUrlConnectionClient.execute(HttpUrlConnectionClient.java:158) at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:151) at com.baasbox.android.NetworkTask.parseResponse(NetworkTask.java:74) at com.baasbox.android.NetworkTask.asyncCall(NetworkTask.java:152) at com.baasbox.android.impl.Task.execute(Task.java:189) at com.baasbox.android.impl.Dispatcher$Worker.run(Dispatcher.java:170)