ably / ably-java

Java, Android, Clojure and Scala client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
85 stars 39 forks source link

Issue when trying to reinitialise Push Notifications after logging out (without exiting the app) #637

Open markcoxsmith opened 3 years ago

markcoxsmith commented 3 years ago

Client Comments I’m having issue when trying to reinitialize ably pn after logout (without exiting app). When logout, our idm remove ably device id from ably side. On app side, i did these things: val activationContext = ActivationContext.getActivationContext(appContext) realtime.close() activationContext.activationStateMachine.reset() activationContext.reset() firebaseUtil.revokeToken() // delete FirebaseInstanceId but the shared preferences still have the ABLY things (key startWith ABLY) and if i do login again, it prints these error:

W/System.err( 6401): java.io.IOException: unexpected end of stream on com.android.okhttp.Address@<REDACTED>
W/System.err( 6401):    at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:203)
W/System.err( 6401):    at com.android.okhttp.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:129)
W/System.err( 6401):    at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:750)
W/System.err( 6401):    at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:622)
W/System.err( 6401):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:475)
W/System.err( 6401):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
W/System.err( 6401):    at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
W/System.err( 6401):    at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
W/System.err( 6401):    at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
W/System.err( 6401):    at io.ably.lib.http.HttpCore.readResponse(HttpCore.java:392)
W/System.err( 6401):    at io.ably.lib.http.HttpCore.httpExecute(HttpCore.java:249)
W/System.err( 6401):    at io.ably.lib.http.HttpCore.httpExecute(HttpCore.java:156)
W/System.err( 6401):    at io.ably.lib.http.HttpCore.httpExecuteWithRetry(HttpCore.java:74)
W/System.err( 6401):    at io.ably.lib.http.HttpScheduler$AsyncRequest.httpExecuteWithRetry(HttpScheduler.java:305)
W/System.err( 6401):    at io.ably.lib.http.HttpScheduler$AblyRequestWithFallback.run(HttpScheduler.java:200)
W/System.err( 6401):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err( 6401):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err( 6401):    at java.lang.Thread.run(Thread.java:919)
W/System.err( 6401): Caused by: java.io.EOFException: \n not found: size=0 content=...
W/System.err( 6401):    at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:202)
W/System.err( 6401):    at com.android.okhttp.internal.http.Http1xStream.readResponse(Http1xStream.java:188)
W/System.err( 6401):    ... 17 more
I/System.out( 6401): (ERROR): AblyActivation: error updating registration <REDACTED>: [ErrorInfo message=unexpected end of stream on com.android.okhttp.Address@<REDACTED> (See https://help.ably.io/error/50000) code=50000 statusCode=500 href=https://help.ably.io/error/50000]

┆Issue is synchronized with this Jira Bug by Unito

sacOO7 commented 3 years ago
sacOO7 commented 3 years ago

Possible solutions

sacOO7 commented 3 years ago