signalapp / Signal-Android

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

Message takes hours to be received #8214

Closed Ceaus closed 6 years ago

Ceaus commented 6 years ago

Bug description

My SO sends me a message on 14:08. I am at work in the office, and I am connected over corporate Wifi. She is at home and connected over our home Wifi. I receive the message when I get home and open Signal to send someone else a message. That is on 19:28. Between work and home, and I'm on my data plan (no hiccups there, using my traffic app while commuting).

This has happened to me before with other persons, but this is the first time I am able to capture a debug log from both ends.

No Wifi or battery saving schemes active. Both phones are on stock Android.

Steps to reproduce

Unknown. Problem is not consistent.

Actual result: Describe here what happens after you run the steps above (i.e. the buggy behaviour)

Expected result: Describe here what should happen after you run the steps above (i.e. what would be the correct behaviour) I would expect the message to arrive much sooner.

Screenshots

wp_20180919_06_38_09_pro

Device info

We have both identical phones with virtually identical setup.

Device: OnePlus 3 (A3003) Android version: 8.0.0 Signal version: 4.25.10

Link to debug log

Mine: https://debuglogs.org/b30c9b21afe71fe776fca3398b2dbcf3d5a5ef3f640579ad969dc6b06c46e48b Hers: https://debuglogs.org/a86492892182f9c8b2c2a5934ac9f195578280f05d1f3d79f6e47bcc13122f0a

pgerber commented 6 years ago

This sound like the same issue also reported as #8004.

Ceaus commented 6 years ago

Possibly. But the TS from #8004 specifically relates the issue to notifications (with some comments adding a messaging aspect too). But I don't have notification issues. This is strictly related to message reception (at least for as far as I'm aware)

bme13 commented 6 years ago

Although you mentioned there's no battery saving setting involved, did you check the troubleshooting guidelines here?

Ceaus commented 6 years ago

Yes, the troubleshooting guide has been duly noted and followed. All green check marks.

minnmann commented 6 years ago

I receive the message when I get home and open Signal to send someone else a message.

Just for clarification, you did not open Signal in between (14:08 to 19:28) and only got the message after opening, right?

Ceaus commented 6 years ago

@minnmann That is correct.

minnmann commented 6 years ago

So I assume that whenever you open Signal, you would instantly receive any message. But the message does not arrive "by itself". Then it indeed seems to be the well-known "push wakeup" issue (the wakeup message from the server (via GCM) is not delivered to your phone, so your phone does not fetch your contact's message from the server).

The troubleshooting guide should resolve this issue, but since it didn't there probably is something else going on, which I am not aware of. Sorry that I could not be of more help!

Ceaus commented 6 years ago

No, your assumption is incorrect. I usually receive messages in the same time frame (i.e. within seconds) after they are being sent. Event when I leave my phone unattended. The issue as described happens a couple of times per month. Not often enough to freak me out, but often enough to submit this bug report.

Ceaus commented 6 years ago

BTW, I wasn't aware of a GCM push wake up issue. Thanks for the pointer.

minnmann commented 6 years ago

OK, sorry that was a misunderstanding on my side then.

I am no Signal developer and don't have sufficient knowledge of the codebase to read and understand the debug log, so I am unfortunately no help there.

However, some of my friends had similar behavior in Signal. But if the messages would not instantly arrive in Signal, the same was true for e.g. WhatsApp. So in these cases at least we could figure out that it was no Signal-only issue, but generally related to push messages. Is something like this also true in your case or do you have this issue only for Signal?

codethief commented 6 years ago

I've been experiencing the same issue as @Ceaus for the last two months. For me it's even more severe, in the sense that I almost never receive a message anymore unless I specifically open Signal. I have followed all the troubleshooting instructions linked above and nothing has done the trick.

The weird thing is that it kind of happened over night. I hadn't updated Signal or changed the settings or anything; suddenly I simply wasn't receiving messages anymore.

I'm running Android 8.1.0 on a stock BQ Aquaris X Pro. Unfortunately, I can't say anything about whether other GCM-based apps like WhatsApp work since I don't use any.

Ceaus commented 6 years ago

Here are screenshots from a conversation with a friend. It suffers from the same delayed reception. Unfortunately I don't have the debug logs. So we have to run this with the screenshots only I'm afraid. 14:52:23 - My friend sends me a message 14:52:30 - Message received by me 15:09:41 - I respond to his message 15:10:46 - My friend sends me another message 20:52:55 - Message received by me, signal-attachment-2018-09-25-212852 signal-attachment-2018-09-25-212857 signal-attachment-2018-09-25-212900

JohnnyMT commented 6 years ago

@codethief: a friend of mine and I also have the bq aquaris x pro, the rest of his family also have bq devices. They are all suffering of this same issue. Since I don't have this issue, we compared versions and the only difference we discovered is that they are running on the latest released Android security patch from bq... Mine is still 5. April, they have a newer one... Maybe this helps in trouble shooting...

minnmann commented 6 years ago

@Ceaus I still suspect this to be the mentioned "GCM wakeup issue". I assume you did not open Signal between 15:10 and 20:52, right? (If you did open Signal and the message did not arrive, then I am mistaken and it is a totally different issue.) Just last week, I experienced exactly this behavior with one of my friends: For about an hour, none of my Signal messages arrived (I only got one check mark) until she opened Signal. I tried WhatsApp - with the same result (only one check mark until she opened WhatsApp).

So, if I may ask, do you have any other app that uses GCM, e.g. WhatsApp, and could give that a try in these moments - or tell your friend to try it in these moments, e.g. whenever he notices just one check mark after a couple of minutes, let him send a WhatsApp message and see what happens?

I think that would help to figure out, if that's a Signal-only issue or if it is really caused by some GCM-related stuff.

Ceaus commented 6 years ago

I assume you did not open Signal between 15:10 and 20:52, right? (If you did open Signal and the message did not arrive, then I am mistaken and it is a totally different issue.)

I may have locked my phone after I sent my response at 15:09. I don't know what that does to Signal as an app. I presume it just keeps on running in the background. I definitely did not close the app deliberately (which can only be done via Settings > Apps > Signal > Close FAFAIK)

minnmann commented 6 years ago

I presume it just keeps on running in the background. I definitely did not close the app deliberately (which can only be done via Settings > Apps > Signal > Close FAFAIK)

Yeah, I did not mean "force close" the app, but just put it in the background. Sorry for causing confusion. What I meant is, between 15:10 and 20:52 you did not use Signal in foreground (= active UI), right?

codethief commented 6 years ago

@JohnnyMT: That's a very interesting observation, thank you! So maybe it is indeed a GCM issue. Unfortunately, I don't know how I would roll back the update…

codethief commented 6 years ago

FYI I just found out that entering the code *#*#426#*#* in the phone app opens up a hidden Google Play Services / GCM(?) debug app. I'm a bit confused by the information there (somewhere it says "connected", somewhere else it says "disconnected"), so once I know a bit better what's going on there and, also, what exactly the ping/connect/disconnect buttons do I'll report back.

Ceaus commented 6 years ago

Yeah, I did not mean "force close" the app, but just put it in the background. Sorry for causing confusion. What I meant is, between 15:10 and 20:52 you did not use Signal in foreground (= active UI), right?

No, probably not.

BTW, I see a similar symptom when I unlock my phone and see Revolut payment confirmations coming it. Way too coincidental that they come in at the exact time I unlock my phone. So is this a GCM issue after all? Pfffff.........

greyson-signal commented 6 years ago

If this is a generic GCM problem with the device (which it sounds like it is, since it's happening with other apps as well), there's not much we can do. However, you can sometimes mitigate GCM problems by disabling things like battery optimization for specific apps. Check out our support article. Thanks!