Closed 2-4601 closed 6 years ago
Wouldn't it be better to keep trying, maybe in larger intervals? (related to #2098)
When a notification is shown, the user will probably open TS immediately but then the connection will still fail.
Happened yesterday. Based on the sent time stamp I was in a basement (or just coming out) at the time when the message was sent to me. The reception in the basement is very poor (mobile network). I only received the message after opening the app 17 minutes later. Usual log: https://gist.github.com/anonymous/62289c74b825c8307f2d
Today a similar case as above. I was in a basement while a message was sent to me. Received it only after opening TS. This time some new exceptions in the debug log:
W/OkHttpClientWrapper( 1801): java.io.EOFException
W/OkHttpClientWrapper( 1801): at okio.RealBufferedSource.require(RealBufferedSource.java:64)
W/OkHttpClientWrapper( 1801): at okio.RealBufferedSource.readByte(RealBufferedSource.java:77)
W/OkHttpClientWrapper( 1801): at com.squareup.okhttp.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:130)
W/OkHttpClientWrapper( 1801): at com.squareup.okhttp.internal.ws.WebSocketReader.readUntilNonControlFrame(WebSocketReader.java:119)
W/OkHttpClientWrapper( 1801): at com.squareup.okhttp.internal.ws.WebSocketReader.readMessage(WebSocketReader.java:94)
W/OkHttpClientWrapper( 1801): at com.squareup.okhttp.internal.ws.WebSocket$ReaderRunnable.execute(WebSocket.java:355)
W/OkHttpClientWrapper( 1801): at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
W/OkHttpClientWrapper( 1801): at java.lang.Thread.run(Thread.java:818)
And more:
W/JobConsumer( 1801): org.whispersystems.textsecure.api.push.exceptions.NonSuccessfulResponseCodeException: Unable to parse entity
W/JobConsumer( 1801): at org.whispersystems.textsecure.internal.push.PushServiceSocket.retrieveDirectory(PushServiceSocket.java:367)
W/JobConsumer( 1801): at org.whispersystems.textsecure.api.TextSecureAccountManager.getContacts(TextSecureAccountManager.java:207)
W/JobConsumer( 1801): at org.thoughtcrime.securesms.util.DirectoryHelper.refreshDirectory(DirectoryHelper.java:49)
W/JobConsumer( 1801): at org.thoughtcrime.securesms.util.DirectoryHelper.refreshDirectory(DirectoryHelper.java:40)
W/JobConsumer( 1801): at org.thoughtcrime.securesms.util.DirectoryHelper.refreshDirectory(DirectoryHelper.java:34)
W/JobConsumer( 1801): at org.thoughtcrime.securesms.jobs.DirectoryRefreshJob.onRun(DirectoryRefreshJob.java:33)
W/JobConsumer( 1801): at org.whispersystems.jobqueue.JobConsumer.runJob(JobConsumer.java:76)
W/JobConsumer( 1801): at org.whispersystems.jobqueue.JobConsumer.run(JobConsumer.java:46)
W/JobConsumer( 1801): org.whispersystems.textsecure.api.push.exceptions.PushNetworkException: javax.net.ssl.SSLHandshakeException: Handshake failed
W/JobConsumer( 1801): at org.whispersystems.textsecure.internal.push.PushServiceSocket.getConnection(PushServiceSocket.java:597)
W/JobConsumer( 1801): at org.whispersystems.textsecure.internal.push.PushServiceSocket.makeBaseRequest(PushServiceSocket.java:482)
W/JobConsumer( 1801): at org.whispersystems.textsecure.internal.push.PushServiceSocket.makeRequest(PushServiceSocket.java:467)
W/JobConsumer( 1801): at org.whispersystems.textsecure.internal.push.PushServiceSocket.getMessages(PushServiceSocket.java:180)
W/JobConsumer( 1801): at org.whispersystems.textsecure.api.TextSecureMessageReceiver.retrieveMessages(TextSecureMessageReceiver.java:139)
W/JobConsumer( 1801): at org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob.onRun(PushNotificationReceiveJob.java:36)
W/JobConsumer( 1801): at org.whispersystems.jobqueue.JobConsumer.runJob(JobConsumer.java:76)
W/JobConsumer( 1801): at org.whispersystems.jobqueue.JobConsumer.run(JobConsumer.java:46)
W/JobConsumer( 1801): Caused by: javax.net.ssl.SSLHandshakeException: Handshake failed
W/JobConsumer( 1801): at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:390)
W/JobConsumer( 1801): at com.android.okhttp.Connection.upgradeToTls(Connection.java:201)
W/JobConsumer( 1801): at com.android.okhttp.Connection.connect(Connection.java:155)
W/JobConsumer( 1801): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:276)
W/JobConsumer( 1801): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
W/JobConsumer( 1801): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)
W/JobConsumer( 1801): at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
W/JobConsumer( 1801): at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89)
W/JobConsumer( 1801): at com.android.okhttp.internal.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:25)
W/JobConsumer( 1801): at org.whispersystems.textsecure.internal.push.PushServiceSocket.getConnection(PushServiceSocket.java:586)
W/JobConsumer( 1801): ... 7 more
W/JobConsumer( 1801): Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0xb7d6e7a8: Failure in SSL library, usually a protocol error
W/JobConsumer( 1801): error:1407743E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert inappropriate fallback (external/openssl/ssl/s23_clnt.c:770 0xac5c2f89:0x00000000)
W/JobConsumer( 1801): at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
W/JobConsumer( 1801): at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:318)
W/JobConsumer( 1801): ... 16 more
plus the usual 100 tries. https://gist.github.com/anonymous/044dce094e6a3615ddb4
I tested today with these steps:
Log: https://gist.github.com/anonymous/add46cfe6edb7814aaee
+*********05
is the sending device. I think there's one message in the log that was sent and received before Nexus going in the pot.
Today I did a similar test with the pot as above: https://gist.github.com/anonymous/41bb29783a6ff49d0cd0
This time the messages did arrive without explicitly opening Signal. Just had to wait a minute or so after getting the phone out of the pot. Perhaps in my previous pot test the messages would have been downloaded without opening Signal. But for certain the situations before that (when I was in the basement) did require explicitly opening of TS.
GitHub Issue Cleanup: See #7598 for more information.
In somewhat rare cases when receiving messages in the background TS gets the GCM message but fails to download the actual message. The messages finally get retrieved when the user opens TS manually. However in these cases TS should give the user a general notification of a new message instead of failing silently.
Two example cases:
In https://github.com/WhisperSystems/TextSecure/issues/970#issuecomment-129680571 moxie wrote: