-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delayed/missing push messages #970
Comments
I can confirm this problem, see #937. Please correct me: GCM works on a "best effort" basis. Messages can arrive at any time in any order. And it seems that this is not just an academic problem, it's actually happening. We need some "server notices that a message has not been delivered and resend it" mechanism. Maybe possible with the delivery reports (#957)? Resending means, however, that the client would need a mechanism to deal with these duplicate messages (those would be two GCM messages; it would need to detect the duplicate content) - but he needs that anyway, see #937. |
Issue #1029 may also be caused by this. |
Edit: This was a user error. leaving the following up for reference. I am having this issue as well, Alice's messages go through immediately to Bob, but Bobs messages get delayed/don't arrive (been testing for two days/a few hours), though they are shown as sent on Bobs phone. This happens with both phones on WiFi, and with both phones on mobile data. This also caused a confusion of encrypted sessions that are ended "simultaneously" (during the delay), which led to lots of "bad encrypted message" errors, and the inability to reestablish a secure session. This could only be solved by reinstalling the app. After reinstalling the delayed messages were delivered immediately (but as "bad encrypted messages" obviously). Devices are Nexus 4 and Nexus 5 with stock Android. This makes TextSecure push completely broken. Multi hour delays/delivery failures, while both parties are online, without the sender being notified is just the worst kind of broken for a communication program. |
#1038 Might be related. |
Having exactly the same problem as Certhas, for multiple days now. Everything works fine when forced to SMS-only, so the problem appears to be in the transport, rather than the app or the phone. |
I too can confirm this, running on a HTC Desire Z with Android 2.3.3 and Textsecure 2.0.4 Messages arrive instantenously from Alice to Bob, but do not seem to arrive when send from Bob to Alice even though they are shown as sent. The initial key exchange works fine and also the exchange of encrypted messages via SMS works fine. I would very much like to see this problem solved, since it prohibits me from spreading Textsecure among my friends. |
Is the background of your messages blue also? It seems to be green if the mesage was actually received, but mine all have a blue background. |
@Nordic89: Green messages are sent via SMS and blue messages are sent via push. As I described, everything works for SMS text messages, but push messages (the blue ones) only arrive immediately when sent from Alice to Bob and not when sent from Bob to Alice. |
So in my case it turned out to be a user error. Alice had restrict background data on the google services app checked (the tricky bit being that it still transfers some data and thus doesn't actually display as restricted in the list of apps). Alice had not been using any chat applications but was relying on SMS before. While this is a user error, it's fairly non-obvious. Some online tutorials online suggest doing this for privacy/data/battery reasons (as google services has been known to be buggy at times). Alice presumably did this without being aware that google services would have anything to do with delivering messages in a superficially unrelated SMS replacement app. I don't know if this is technically possible, but it would be great if text secure could pop up a warning box if it detects that background services are restricted. |
@behrmann |
@Certhas I'm not sure if that's possible to detect, but it'd be cool if you did some research to see whether there's an API for that and reported back. |
The recommendation from ICS onward seems to be to use something like the following if you're running in the foreground or the background, but that's not really helpful unless it's TS code running. AFAICT it will take into account the global "Restrict background data" state, but I can't find any way to query it for a specific other app (like the @Certhas case of Google services being explicitly disallowed from using background data). ConnectivityManager connectivityService = Context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo network = connectivityService.getNetworkActivityInfo();
if (network != null && network.isAvailable()) { // or network.isConnected() here
// background data should not be restricted
} I wonder if this is another thing that can just be addressed by better messaging around the push transport (you need to have Play services/GCM running and able to access the network in the background, etc.). |
Today it happened again to me: Yesterday evening I sent a push-messages to a colleague while his phone had no data connection. It was delivered about 10 hours later this morning. I'm curious now: What service level does GCM offer? For example, does it guarantee delivery? What about caching, why does it take so long to deliver a message after a device regained network connectivity? |
@wickedshimmy The problem is that I don't see how to differentiate between "no internet connection" and "background data restricted" with that code. Do you know if any of these checks explicitly only fails if background data is restricted? |
No, that was sort of my point -- since ICS you can't. If you query the |
Is it confirmed now, that the Problem is with restricted background data? I just wonder, because I habe not restricted background data and habe both been the party to not receive PUSH messages and to send PUSH messages that have not been received (with two different communication partners). |
I have confirmed that neither of the devices I'm having trouble with have restricted background data enabled. The one that is having the most trouble sending/receiving does wander through areas of reduced cell service, but still fails to send messages that are created once it's back in a good service area until much later, all with no indication to the sending user that the message has not been delivered. |
I don't have background data restricted, yet still can't send any messages. |
@Nordic89 can't you sent messages altogether or are they delayed heavily? |
By the way: Restricting background data should never interfere with sending messages. If you can't send messages, something else is wrong... |
@JavaJens Sms work just fine, I can't send any messages whatsoever by using data. They are not just delayed, they never arrive. I receive messages just fine. |
@JavaJens: Sending never seems to be the problem (at least not in the cases I witnessed), but very late delivery/no delivery of messages is and the latter always seems to be a one-sided problem. |
But it his comment @Nordic89 clearly said "I can't send any messages", |
@JavaJens That's right. I can not send any messages (via push, that is). I'm registered at the server and I don't personally see anything wrong when I try to send a message, but they just don't ever arrive. |
Could you provide a debug log? Maybe we can see an error message in the |
Don't know if that helps. http://hastebin.com/losawogiji I just tried to send another message, but I don't exactly know what the log logs, so it might not be included. If you need anything else just tell me what to do. |
@Wikinaut the android version on his phone is 4.1.2, I guess, but I have no idea where to find such settings on an lg rom. But I'll check it again anyway! |
Split off my stuff as new issue #4052 since symptoms weren't exactly the same. |
As a follow up to my own previous post, I've now tried "push notifications fixer" from Google play with various settings but no success. Now I've been paying attention to it, I've found that all text secure messages sent to me are delayed if I have another app in the foreground. It's really frustrating! Unless it's the only way is to regenerate new keys (or reinstall the app) I'm not prepared to do that as I've got a lot of people using text secure who I often talk with. It seems crazy to have to ask them all to accept a new random key from me, keys shouldn't change for no significant reason. If anybody has any suggestions or knows anything I can do to ensure GCM will work reliably with Text secure please let me know. (I seem to get gmail in a timely manner) |
if you just unregister and reregister, your keys won't change On 09/10/2015 06:26 AM, donateur wrote:
|
@moxie0 Thanks, I hadn't realised that! Unfortunately I cannot actually unregister as the app keeps crashing after I click OK on the OK in the dialog box, this happens even after a reboot of android. Could this be a hint toward the cause of the delayed messages? PS: Thanks for your work on this great app! Textsecure is the first fully encrypted messaging app which I've been able to get nontechnical members of my family using. It's seamless to them (aside from this unfortunate problem which also affects my mom anyway!). |
It seems to be in some kind of in between state now. One user reported problems messaging me, until I messaged him. Thanks |
Ok, I'm unregistered from secure messages, even though the app crashed while doing so. The app believes I'm still using secure messages though. |
Please post a debug log |
Looks like you don't have google play services installed, or your gapps install is otherwise messed up. That is the cause of both the crash as well as your failure to receive notifications. |
OK, any suggestions please? I'm not aware of problems with any apps or google services. |
@donateur try using a gapps zip from http://opengapps.org/ |
@bonanza123 Thanks! I hadn't heard of that site before. I was able to flash the Google Apps without problem, and cleared caches, but after reboot TextSecure still wouldn't let me unregister/re-register for Secure Messages. This doesn't resolve the problem my mom has, as her phone is running stock Android. I'll try to get more evidence/debug log. Thanks for your help guys. |
Just opened EDIT: and unlocked TS and received a message from 16 hours ago. Used the phone all day long expect for TS. The other day was similar, though I opened TS only some hours after the message was sent https://gist.github.com/anonymous/c916ce1fb7ea807760d9 |
Maybe these information are already known. I've already posted them in #4070.
Needless to say that none of the usual explanations like using Titanium fits here. |
In my case the problem was solved with upgrade to TS 2.26.5. But i can't tell the reason, because PlayStore forced me remove some apps and i also upgraded some Google-apps at the same session.
|
I reported on this issue 18 months ago. I fixed it back then by reregistering. Haven't had the problem again since then. Maybe this very broad and general ticket could be closed. I do not know if any of the other early reporters have seen the issue of missed/delayed messages again lately? |
I support the idea to close this broad general ticket. I haven't had any delivery issues lately. |
closing, please reopen if you encounter this again... |
i also have this problem on the phone from my wife. (fairphone - latest updates) i tried everything/alot, gapp reinstall, google services to latest version, Push Notifications Fixer (changed nothing) .... - mobile internet working fine. also if the app is in foreground everything is fine. a few seconds after close - everything fine. but then after 5minutes or 2 or 30min , no messages |
Just for the record: My Problem is solved, without changing something. The problem started in January last year out of nowhere. I know now, it was a GCM issue. The same day jnachtigall commented two weeks ago the problem was solved without changing something. All other GCM apps started working again too which did not work for the last year too. To make that clear again: I haven't changed any google settings or anything related on this phone since months, because I already gave up on this issue. |
@Frankstar I think you should send the Signal debug logs from your and your wife's phone (See the point Debug logs under https://github.com/WhisperSystems/Signal-Android/wiki/Submitting-useful-bug-reports#how-to-capture-data) |
well, thats weird. |
@Frankstar I've owned a Fairphone before, and part of what you describe sounds familiar to me. After every update to, say, a new FP OS, my phone wouldn't connect to Play Services, so that Google Cloud Messaging wouldn't work. After a week or so, my phone would automatically connect to Play Services again. Before that, an update of an arbitrary existing app or the download of a new one would lead to a connection, so that Signal messages would be received again. See a post in the FP forum: https://forum.fairphone.com/t/phone-not-connected-to-google-play-services-after-every-reboot/6279 If the behavior reappears, you could enter |
@AlfonsoMuskedunder Ty for the tip ( |
When messaging a friend of mine via push, most messages are delayed a few hours. Background data is enabled. Sometimes messages are even not delivered at all or arrive in different order than sent. This also happens with messages other people send him, although I can exchange messages with these people without problems (delivered within a few seconds). He runs a Nexus 5 with the latest stock Google Android and is perfectly reachable via Hangouts the whole time.
Any idea how to debug this?
The text was updated successfully, but these errors were encountered: