signalapp / Signal-Android

A private messenger for Android.
https://signal.org
GNU Affero General Public License v3.0
25.32k stars 6.08k forks source link

Delayed/missing push messages #970

Closed fd0 closed 8 years ago

fd0 commented 10 years ago

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?

rbieb commented 10 years ago

I don't know Moxies exact reason for only relying on GCM. I agree that having an alternative option would be nice, especially because it would allow people to still use the app without having google apps on their phones. Textsecure is currently the only app I need google apps for, if I could, I'd get rid of them completely.

bungabunga commented 10 years ago

As far as i unerstood GCM is the only option for PUSH which is far more relyable option for asynchronous messaging than PULL. The later is also in the works but would behave much worse.

On Wed, Apr 23, 2014, at 20:06, Nordic89 wrote:

I don't know Moxies exact reason for only relying on GCM. I agree that having an alternative option would be nice, especially because it would allow people to still use the app without having google apps on their phones. Textsecure is currently the only app I need google apps for, if I could, I'd get rid of them completely.

Reply to this email directly or [1]view it on GitHub. [2994878__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMzg5NTU5M CwiZGF0YSI6eyJpZCI6MjY4Mzc3NDV9fQ==--363bd4404d6fa3de361c425cab4d40c231 c76bfd.gif]

References

  1. https://github.com/WhisperSystems/TextSecure/issues/970#issuecomment-41194598
wickedshimmy commented 10 years ago

Is there a reason why the whole messages are sent via GCM? It seems to place a lot of trust in the service...

GCM is used as an untrusted transport; there's no reliance on it for any of the secrecy guarantees TextSecure makes. Using it as you suggest for a notification without the entire message would leak the same amount of information.

As for "refresh" or any form of polling for/requesting messages from the TS server, I believe the primary concern there is scaling that to the number of messages through the network, but someone else can chip in who's actually worked on the server.

mcginty commented 10 years ago

@Nordic89 There's been much discussion and explanation for why GCM is currently used as the push transport for Android, and there's also an existing effort that's underway to support the no-Google case. See #127 for the notoriously exhaustive Play alternative distribution discussion, and #1000 for the discussion on WebSocket support.

@ykarm I also really like how Threema does its fallback, and I think it's something we can end up emulating when the proper parts are in place. We seem to be on the same page as far as this compromise being a good ultimate setup.

It's probably worthwhile to reiterate that we want to see this happen too. TextSecure's developer resources simply aren't at the same level as big for-profit projects, and we don't have the capability to immediately support our own global push network or multiple alternative delivery protocols on the first release :).

Wikinaut commented 10 years ago

Am 24.04.2014 22:57, schrieb Jake McGinty:

It's probably worthwhile to reiterate that we want to see this happen too. TextSecure's developer resources simply aren't at the same level as big for-profit https://blog.twitter.com/2011/whispers-are-true

mcginty commented 10 years ago

@Wikinaut http://support.whispersystems.org/customer/portal/articles/1474591

Holzhaus commented 10 years ago

Possible workaround: I had the problem of not receiving messages from a particular TextSecure-Contact at all. Sending worked though. The workaround was to disable Push Messaging and re-registering my phone number. Now it works fine. The phone number was correct before re-registering, too, so that should not have been the problem.

jnachtigall commented 10 years ago

I have the very same problem as @Holzhaus from previous comment: I can send messages to my friend. However, all my friends messages that are sent to me are lost. I did not try the workaround yet, but I am happy in helping to debug, if you need any further information. Let me know if I should do something...

We switched to Threema in the meantime since not receiving messages (which are shown as being successfully sent on my friends phone) is simply not accetable :-(

JavaJens commented 10 years ago

@jnachtigall Could you maybe get the debug log or check if you have any special errors? Maybe you could coordinate with a friend to specifically check the time messages should be arriving.

fajabird commented 10 years ago

Until I re-registered my phone number to the server by unchecking push-messages I was not able to receive any messages while all my messages have been delivered correctly and timely. Now it works again. In between I have restored TextSecure from Helium-Backup which possibly caused that problem because also my ROM and Android version have changed between taking the backup and restoring.

bungabunga commented 10 years ago

@fajabird never backup TextSecure with another app! it's proved to cause issues.

fajabird commented 10 years ago

Thanks for pointing this out.  It's not obvious and there are some followup questions.  So why do you allow taking adb backups,  you should disallow them in the apk manifest. And is there a way to make them work,  it's a pain not being able to backup and restore to the same device.  I'm not even talking about restoring to other devices. 

-------- Ursprüngliche Nachricht -------- Von: bungabunga notifications@github.com Datum:30.06.2014 20:30 (GMT+01:00) An: WhisperSystems/TextSecure TextSecure@noreply.github.com Cc: fajabird artur@jaroschek.net Betreff: Re: [TextSecure] Delayed/missing push messages (#970)

@fajabird never backup TextSecure with another app! it's proved to cause issues.

— Reply to this email directly or view it on GitHub.

fajabird commented 10 years ago

Hi,

another question coming to my mind: there should be some kind of error report on sender or on receiver side if a message cannot be delivered. In my case I had to call the other party to ask if he got my messages and did reply.

On 30. Juni 2014 20:30:22 MESZ, bungabunga notifications@github.com wrote:

@fajabird never backup TextSecure with another app! it's proved to cause issues.


Reply to this email directly or view it on GitHub: https://github.com/WhisperSystems/TextSecure/issues/970#issuecomment-47568077

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

vollkorn1982 commented 10 years ago

Got the problem that push messages never arrive as well. Here's my log: http://hastebin.com/utayudopak

rumpeltux commented 9 years ago

I also had the problem that I would not receive any messages from other’s despite having push messaging enabled. People who sent me messages where seeing these as delivered though.

Disabling push-messaging and re-enabling (including reregistering my phone number) seems to have solved the issue for me.

fd0 commented 9 years ago

This still happens with the latest version of TextSecure between my device (Nexus 5, stock Android) and a friend (Nexus 5, stock Android). At least now we're able to see that messages are lost due to the delivery reports. This mostly seems to happen when the receiver has an unstable network connection (e.g. bad cellphone coverage). Both devices have enough storage for receiving messages.

Is there any way to debug why these messages have been lost in transit?

janvlug commented 9 years ago

I can confirm that it still happens for me as well. Another observation that I mad is that I have delays when my phone is not used (i.e. the screen is off). Quite often it happens that I only get the messages when I turn on the phone. I also noticed that delivery messages sometimes get lost (or are not sent at all). It happens that the recipient does receive my message, but I do not receive a delivery confirmation. See also #2098.

tx3eh8IUD1 commented 9 years ago

I have the same problem that some messages don't come through (both clients are updated). The funny thing is that it just affects some messages between A and B, not all of them. Some messages just seem to get lost. It's very helpful that TextSecure now tells you if they have gone through or not! This seems to work for me.

ghost commented 9 years ago

Where are the developers???

devurandom commented 9 years ago

Copying my issue description from #2293:

Currently message delivery is unreliable. It often happens that I send a message to someone, but do not get a message receipt (check-mark icon). Messages sent later get a receipt. When I talk to the person a few hours later, they tell me they did not receive the message.

This issue is not limited to me sending, but also happens the other way around. It also happens for other people, as I have been told. It also happens for the message receipts themselves – sometimes a message arrives on my phone, but the sender never receives the receipt. The CyanogenMod integrated WhisperPush service is not involved. The issue happens between stock Android users, as well as with CyanogenMod users.

From reading other issues I understand that GCM does not offer reliable delivery. I wonder if the equivalent of XEP-0198 section 4 "Acks" could be implemented on top of it in TextSecure.

Possible duplicates: #679, #970, #1971, #2098, #2238

rfugger commented 9 years ago

I'm also having this issue. I was having it over a year ago and disabled push messages because SMS was far more reliable. I started having multiple issues with encrypted messages over SMS (#2316, #2317), so I went back to push. Now I'm still getting delayed messages, missing messages, and messages claiming to be sent/received on the sender's device, but not yet received on the recipient's.

janvlug commented 9 years ago

Do you mean with "...messages claiming to be sent/received on the sender's device, but not yet received on the recipient's" that you sent messages for which you see the delivery notification 'tick-in-the-box' while they were not received by the recipient? Such behavior has not been reported until now and would severely undermine the reliability of the receipt notifications.

rfugger commented 9 years ago

@janvlug - I hadn't noticed the addition of the little checkbox to the UI, sorry for the confusion. You're right, there is no checkbox on the messages that failed to be delivered. I just went by the "Message details" popup. For example:

Transport: PUSH
Sent/Received: Sat Jan 31, 2015 - 07:01:25 PM PST

This status message implies the message has been received when it has not. Maybe it should be changed to say something along the lines of:

Transport: PUSH
Sent: Sat Jan 31, 2015 - 07:01:25 PM PST
****NOT YET RECEIVED****
rfugger commented 9 years ago

I would also propose that sent but not yet received push messages be shown in red, or with a red triangle exclamation point warning icon, and "delivery pending" or some such status below it to show that they have not been delivered, because neurotically checking for the little checkmark to show up isn't practical. I didn't even realize the checkmark existed until now :)

gartenriese2 commented 9 years ago

@rfugger: I think that's a good idea. Maybe not showing the whole message in red but a red warning sign is good.

rfugger commented 9 years ago

Also, most importantly, the app should raise a notification to the user, after a certain timeout, that a message has failed to be received, and not just fail silently. I believe it already does this with SMS messages that can't be sent...?

devurandom commented 9 years ago

Maybe show the checkbox without the checker mark.

@rfugger I do not think it does that for SMS. And please note that receipients may disable deliver notifications, so you will never get a checker mark. Bothering the user with notifications in this case is not sensible. And it is (should be!) impossible to destinguish a receipient who has not received a message and one who has disabled delivery notifications.

rfugger commented 9 years ago

@devurandom Then make the notification say what it really means -- "No delivery confirmation was received for this message. Message delivery may have failed, or the recipient may have disabled delivery verification." Touching the notification takes you to the relevant message. Two options on the notification: "Disable warnings for this contact" and "View message". Yes, this would probably require a new settings screen to manage disabled warnings.

I can't keep using this app if it drops messages silently, and I'm not going to sit and watch for the checkbox to appear for each message, nor is it useful if I occasionally scroll back through all my conversations looking for missing checkmarks just so I can realize, "Oh, that's why Alice didn't show up to the meeting on Tuesday."

This is a major issue IMO.

devurandom commented 9 years ago

IMO the issue exist with all forms of communication. If Bob wants Alice to show up, he asks her to confirm the meeting…

Do not get me wrong, I understand your frustration. But TS should be responsible to reliably deliver messages. And in some situations, like empty batteries, shutdown phones, shielded rooms or network takeouts, it will still fail at that. And it is impossible for it to distinguish between "message that needs immediate confirmation" and "message that is ok to be delivered a day later". That's where IMO the human comes into play and asks for a confirmation in the old-school way: "Please confirm."

One idea though: Shouldn't it be cryptographically possible to check that both endpoints have the same message history? So it should be possible for Alice to notice that she missed a message. And Bob's later messages could be marked in some way, if they have got "delivered" status, but an older one does not, so he knows there is a divergence of history somewhere in the past.

rfugger commented 9 years ago

@devurandom Just number the messages. If a number is skipped, then the recipient knows they missed a message? This might help messages be delivered in order too. GCM's best-effort delivery is essentially UDP -- the ultimate solution is to implement "TCP" on top and start retrying un-acked messages to guarantee in-order reliable delivery. It's not anything novel.

Until you do, though, what you're talking about isn't a technical challenge, it's a UI challenge. You know you're dealing with an unreliable transport, and that you haven't received confirmation yet -- how are you going to communicate this to the user? Requiring manual confirmation from the recipient is just giving up. TS is an instant messaging app -- you have to assume by default that every message requires immediate delivery. Far far better to err on the side of over-warning about undelivered messages than to fail silently even once. Then, as I said before, give the user an intelligent option to disable warnings that they don't want to see. That's all.

janvlug commented 9 years ago

I like the idea of having an explicit warning if a message delivery has not been confirmed after a certain amount of time and automatically re-sending (#2098) did not get it delivered either.

rfugger commented 9 years ago

Sorry, one more thing stuck in my craw here:

@devurandom

it is impossible for it to distinguish between "message that needs immediate confirmation" and "message that is ok to be delivered a day later". That's where IMO the human comes into play and asks for a confirmation in the old-school way: "Please confirm."

Not being able to decide between a 2-minute timeout and a 24-hour timeout on an error message is not justification for never displaying that message at all! (Besides, a few minutes is the obvious choice for this app -- not a hard decision at all.)

devurandom commented 9 years ago

I am not sure that TS understands itself as an instant messaging app. I think the whole concept of instant messaging comes from desktop computers, connected to the internet during their whole uptime, with a person in front of each, writing each other and paying attention to their screens. Messaging on cellphones, which you carry in your pocket for a day without looking at it, which you might shut off / silence or which might not be connected to the network for extended periods of time – that is a completely different usecase.

I agree that it should be possible to easily and quickly see that some contact did not get your messages, but please do not bother me with notifications for every message that takes longer than a few minutes to be delivered.

Further thinking about my proposal ("One idea though"): Showing the user that his message history is diverged should never be necessary. Behind the scenes TS might use such a mechanism to ensure delivery, but if the user becomes aware of it, TS already failed. (And until TS is actually reliable, we have the checkmarks.)

Re: numbering messages: Might be difficult, since you have two message histories, or even more in group conversations. Giving each message a "parent" seems more appropriate. But these are mere technical details, which I entrust to Moxie and his colleagues.

rfugger commented 9 years ago

@devurandom I suppose you're right -- you can't really notify for messages not delivered immediately when the recipient's phone is off, for example. And if TS doesn't track online presence, then it's a tough one. All I know is that I haven't lost more than a couple SMS messages in the past few years, and now that encrypted SMS is broken for me, I'm losing about one push message a day and that's not acceptable. If there's no solution soon, I'm going to have to abandon TS unfortunately. It's just not a useful app anymore.

ghost commented 9 years ago

I'm not sure about you guys, but this problem seems to have been fixed in the past couple of days. All my messages are being delivered and my friends say theirs are being delivered, too. Can you confirm this?

janvlug commented 9 years ago

On 31 January 2015 a message was sent to me that never arrived.

ghost commented 9 years ago

On Jan 31 I was having issues too. I send/receive a few hundreds of messages a day and yesterday I had no problems the whole day. Same today so far The only issue is that some messages are not istantaneously delivered. Would probably get fixed if this behaviour was implemented into TS -> https://play.google.com/store/apps/details?id=com.andqlimax.pushfixer.noroot

rfugger commented 9 years ago

I haven't had any of my sent messages dropped since Jan. 31st either.

ghost commented 9 years ago

Yeah, the problem seems to have been fixed. I only missed a delivery receipt so far.

bonanza123 commented 9 years ago

Previously, most of the messages I / my friend missed occured when the receipient's phone was offline for a couple of hours (e.g. over night). Has anybody of you tried this scenario since 31. Jan ?

Wermorl commented 9 years ago

I have the problem since ca mid of january, that i can sent messages and the arrive at the Destination but the replys never reach me. This happens only with other ts contacts. Firts i did not realyze was just wondering why nobody replied. I tried everything: unregister reregister fresh install etc. The only way i got things back working was to unregister and switch off push. Here is my log :

https://gist.github.com/989bbbb95979f4c731df

moxie0 commented 9 years ago

@Wermorl The best place for support is the support center: http://support.whispersystems.org

Wermorl commented 9 years ago

@moxie0 Thanks moxie0! I had the feeling that it is better suited here because at support.whispersystems.org doesn't seem to happen much, but i will ask for support there too. I already sent an email to support@whispersystems.org in January, but there was no reply.
If i can help debugging this issue, let me know.

BTW: Your pestilence movie is great!

rhodey commented 9 years ago

as of 2.6.4 TextSecure now uses a combination of GCM + WebSockets to improve message reliability, closing this issue now as non-reproducible and stale. if anyone is still experiencing this behavior after updating to 2.6.4 with use of WebSockets for receive, please check in and provide a debug log then this issue can be reopened.

Wermorl commented 9 years ago

Thanks for your Work. I just registered again and i am not able to reproduce this issue! Great! It is the first time it works via push since January.

Cheers

wermorl

Sinlicious commented 9 years ago

@rhodey & @moxie0 - I believe I am still seeing this behave as posted here: https://github.com/WhisperSystems/TextSecure/issues/2703#issuecomment-85426449

Happy to help where I can - just let me know!

Wermorl commented 9 years ago

@Sinlicious me too. For Example i had Messages sent to me on Friday Morning ca 8:00 o'clock and received them about 18:00 o'clock.

rfugger commented 9 years ago

Last week I also noticed one of the push messages I received from this person took 18 hours to get to me despite always having a data connection. The message only arrived when I brought up textsecure manually after not using it in a while (and presumably Android killing it in the background so bringing it up restarted it), similar to @Sinlicious in his #2703 comment above.

NinnOgTonic commented 9 years ago

I'm still experiencing this issue in version 2.16.4.

Wermorl commented 9 years ago

Me too. it only happens if other TS users send me a message. As soon as i open TS the message is received. Background data is enabled, no Firewall enabled on the device, open Wifi or Cellular network. No taskkiller or anything like that running.