signalapp / Signal-Android

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

Messages sometimes show up late and/or in bunches #8692

Open jeremymasters opened 5 years ago

jeremymasters commented 5 years ago

Bug description

Typing on the desktop client and after awhile I heard my phone buzz. Opened it up and a flood of signal messages come in that were from the last several minutes (15 minutes maybe)

Steps to reproduce

Actual result: signal messages from recent history flood in Expected result: messages come into phone roughly at the same flow as desktop while on the same network

Device info

Device: Samsung galaxy s9 Android version: 9.0 stock Verizon Signal version: 4.35.3

Link to debug log

https://debuglogs.org/6d156ab53db2297c534498e59937440ab48bb8d5ef77527afd850adcaa89c26f

greyson-signal commented 5 years ago

Looking at your log, I'll assume your referring to right around here:

2019-03-18 09:05:07.118 MDT I FcmService: FCM message... Original Priority: 1, Actual Priority: 1

Which is point where we get a ton of FCM messages.

Unfortunately, Android isn't super kind with GCM/FCM message delivery these days (read: Android 8 and above). We send high-priority notifications, but the system itself may still batch them together, particularly if your phone is sitting still on your desk disconnected from a charger. It's a battery optimization that's particularly harmful to messengers.

You can check to see if disabling battery optimizations in your system settings helps, but this particular behavior tends to pop up from time to time even if battery optimizations are off. We're looking into some possible workarounds.

jeremymasters commented 5 years ago

All battery optimizations for signal are shut off and it was off the charger. It's set as my default SMS client, so battery opts are not allowed to be turned on by me. I suppose going on under the hood.

Noah-Huppert commented 5 years ago

Signal Android 9, I can reproduce this bug.

Let me know if there are any additional diagnostic steps I can take to help with this bug.

Maybe the app could detect when a bunch of notifications are coming in (X # of notifications for messages older than Y minutes) and delay notifications for a bit.

jeremymasters commented 5 years ago

@Noah-Huppert this bug is more to do with the fact that in, say a window of time where messaging via desktop is occurring, FCM doesn't let the phone know until late in that window...sometimes many minutes later. I'm not as worried about rapid-fire notifications. I don't know squat about FCM, so if you know about that, you'd probably be able to help.

Noah-Huppert commented 5 years ago

Although I am annoyed by my desktop and phone not being in sync, I feel like the only thing Signal can do is manage the groups of notifications. I'm not sure how much control we could have of cloud messaging.

FedericoCeratto commented 5 years ago

I'm seeing a similar behavior: the desktop client and phone sync outgoing messages very quickly, showing two white circles, and the recipient does not get messages for up to 40 mins. Same with incoming messages.

dlemire60 commented 5 years ago

I don't use the desktop app, but both my wife and I frequently experience delayed notification / message delivery on our Moto G5s phones (Android 8.1.0, security patch level 1 April 2019) running on Sprint (via reseller Ting). Message notifications are sometimes very prompt, sometimes quite delayed (30 min in some cases). Things seem fine while in an exchange, but it's common to unlock the phone and only then get notification of a message(s) (I just had that happen with a 15-min old message).

Battery optimization is off (at least on my phone, I think both). I have all requested Signal permissions enabled except Calendar and Location.

dlemire60 commented 5 years ago

Just had another instance, where a message from another Signal user took 12 minutes to show up on my phone. This is very frustrating behavior. I really like this app, prefer to have the security it provides, and was very impressed with the quality of a 2-party video call when I used that. But the lack of timely delivery is a real negative that's causing me to re-think continuing to use the app.

App version: 4.43.8, installed from Google Play store, routinely updated

Android version: Android 8.1.0, security patch level 1 April 2019, no custom ROMs, not rooted

Device model: Moto G5S Plus phone

janvlug commented 5 years ago

I received a message from *75 at 9:04:27 PM GMT+02:00 that was sent at 5:55:08 PM GMT+02:00. Here is the debug log.

flibbles commented 5 years ago

Hey all,

I too am encountering this issue. Have conversation on desktop. Phone catches up later. I don't actually mind much.

What I do mind is how my phone will chime for every single delayed message. So, like, an hour after my conversation, my phone will start chiming constantly for a solid two minutes or so. It's irritating, and unstoppable. Each message appears on lock-screen notification for about half a second.

Can't there be a some way to at least have Signal not chime a bunch when delayed messages come in?

bme13 commented 4 years ago

It's been quite a while since a noticed this behaviour and I think the deliver reliability has improved a lot however this morning a message took nearly 3 hours to be delivered. On the receiving device the message details show: send: 9:28:53 received: 12:20:56 Now I have to say the battery on the receiving device was a bit low < 10% however during the timespan the Signal message was not delivered multiple Whatsapp messages were received. Both Whatsapp and Signal are excluded from battery optimization on the receiving phone. Log sending device: https://debuglogs.org/5af3fb0ada60fcc7b199a7cff2800ac9343be5e67ea65b43f03b6d13978eb376 Log receiving device: https://debuglogs.org/3805b112765ae5838a2012bc0cf2d58d27d02bfd02579a47963139039bf9e123

signaluser2 commented 4 years ago

Today a strange thing happened. Contact had sent message1 at say 00:00 but it wasn't delivered to me. I sent him message2 at 00:45 and got one tick. I didn't receive message1. Contact sent more messages at 01:00 and 03:00 and I did not receive those messages either. Fed up, contact notified me through another channel. I force-quit Signal and re-opened it and immediately got the messages sent by the contact and the read receipt for the one I had sent.

I have always had the problem of not receiving messages on time. So the messages sent at 01:00 and 03:00 not getting delivered is not surprising. But why didn't I get message1 even after I sent message2?

IanSpam commented 4 years ago

This is a new problem on my Signal. There used to be no delay in receiving notification on my phone of new Signal message arriving. Now there is, and often no notification until I open the app. Then it goes off as each notification alert sounds sequentially. This is new behaviour so may be bug in newer version. To my knowledge nothing else has changed. Family members used to mention this to me on their devices but I thought it was probably a notification setting. I have checked every setting I can think of. All seem correct, still no timely notifications. Phone: HTC Desire 530 Android: 6.0.1 Signal: 4.53.7

IanSpam commented 4 years ago

First mention I can find "No Push notifications on data #8400" opened this issue on Nov 27, 2018

greyson-signal commented 4 years ago

@IanSpam Please post a debuglog that was taken after you opened the app and discovered that messages were delivered late. There's a couple things that could happen that would result in delayed messages, and I can see what you're hitting.

greyson-signal commented 4 years ago

@bme13 I saw this snippet in your log:

2020-01-08 12:21:02.995 CET I FcmService: FCM message... Delay: 10022865

Followed by a cluster of other delayed messages. That delay translates to ~2.75hrs. Lines up with what you said.

That means that Signal sent an FCM message to that device almost 3 hours before, but for whatever reason, the device chose not to deliver it to our app for 3 hours. The fact that the receiver's device was in a low battery state sounds like the likely explanation.

And unfortunately device manufacturers aren't neutral deliverers of notifications. They keep their own whitelist of apps they think are important, and it's likely that WhatsApp is on that list, hence why it didn't experience any delay.

Tursko commented 4 years ago

All battery optimizations for signal are shut off and it was off the charger. It's set as my default SMS client, so battery opts are not allowed to be turned on by me. I suppose going on under the hood.

My friends also had this issue on One UI, but I have, at times, experienced the delay myself (Pixel 4). Luckily making Signal 'not optimized' seemed to fix their issues. I know you mentioned that all your optimizations are off though.

MomentofClarity commented 4 years ago

Debug Logs

This was earlier this week, at the time it was working fine for one contact but didn't go through when I sent a message to someone else: https://debuglogs.org/b359c0eb4169e971ba0f7c071b6123d5c674104b90ed1dd083ed4a60724c0ae6

This was just now, I had been talking to someone most of the day with no issues and then it just stopped delivering: https://debuglogs.org/ca9b6ce8d5980dbcdeadbf780419e986446dedf7a4438b3fc67b186d3ab07592


@greyson-signal I've had this issue for over a year. Normally it would just happen 1-2 times a month (negligible), but during some weeks (like now) it's almost unusable...when I message someone it's a coin toss of whether it goes through or not. And then it's another coin toss of whether it's going to be 30 mins or 10 hours later when it finally gets delivered.

I don't think it's fair to attribute it to the handling of the msg by the specific device or things like battery optimization settings as I've experienced it across many different device on all platforms. I've gotten new phones, friends have gotten new phones (including switching from Android to iOS, etc) and the issue still persists, meanwhile it has not happened one single time with any other messenger (to me) literally ever in the last decade.

If it was specific to the device then it would also not persist when multiple devices are actively connected (i.e., phone and desktop client), but it does.

This is a Signal issue. I love the app and have been an advocate since day one, it's by far my preferred messenger. I'm always trying to get friends to switch. And normally it works great, and I can live with infrequent "one-offs"...but there are periods when 'unreliable' is a huge understatement. This past week I've been using alternate messengers or calling multiple people telling them to open Signal so that messages can come through multiple times a day.

Please let me know if there is anything I can do to help diagnose this issue, I don't want to give up on Signal :(

Thanks for your help on this but also generally, I really appreciate you and everyone else that works on this app 🙏🙏🙏

Tursko commented 4 years ago

Encountered the issue today. I was using signal desktop for about an hour and when I went back to my phone all the notifications finally rushed in.

https://debuglogs.org/057079a28e187cd35b9022624b1200b5c9e9ce4b36e8e2d0c4bf915f5da7c6ac

Noah-Huppert commented 4 years ago

I just turned off battery optimizations, we'll see if this fixes the issue.

On Tue, Feb 4, 2020 at 3:04 PM Taylor Riley notifications@github.com wrote:

Encountered the issue today. I was using signal desktop for about an hour and when I went back to my phone all the notifications finally rushed in.

https://debuglogs.org/057079a28e187cd35b9022624b1200b5c9e9ce4b36e8e2d0c4bf915f5da7c6ac

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/signalapp/Signal-Android/issues/8692?email_source=notifications&email_token=AAZLM4ATKGP77KSOL2NSJOLRBHC4JA5CNFSM4G7IHWQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKY75FY#issuecomment-582090391, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZLM4BZM6B6ZQU6KTMX5HDRBHC4JANCNFSM4G7IHWQA .

alcoolfire commented 4 years ago

We had a longstanding problem with a Moto G3 where Signal messages will not be received after a restart and before the first unlock/login. The G3 ran a rather old version of Android, so we lived with it. We have now upgraded to the Google Pixel 3a running Android 10 and we have exactly the same problem. My wife likes to turn her phone off at night. If she forgets to unlock her phone after power up in the morning, it can be hours of delay in receiving messages that came in during the night from another time zone. I have missed multiple incoming Signal voice calls because I restarted the phone and forgot to unlock it so Signal would start functioning. I'm assuming the Signal app does NOT start up in the background until first unlock. Why? I wonder how many people experiencing delayed notifications just haven't noticed this correlation.

BTW, the same problem exists with K-9 Mail. I imagine this could be linked to Google's anti-background app "features", but I didn't think the old G3 would have been plagued with those.

greyson-signal commented 4 years ago

@alcoolfire The problem you're experiencing is true of every app. Your phone doesn't do anything until your first unlock.

alcoolfire commented 4 years ago

@greyson-signal: Thank you. This should be clearly noted whenever someone reports problems of delayed notifications, as it may explain some of them. I take it there's no workaround. Has that always been true going back to older versions of Android? I had never noticed that as a problem on Nexus 4 and 5 devices.

I occasionally restart my phone and walk way rather than wait for its lengthy boot time. I'd better break that habit. I guess that makes automated restarts a rather bad idea too.

shyos commented 4 years ago

Since this is the closest issue that I can relate to my problem, I'm mentioning it in here. Singal-Android does not receive messages(sent from another Android client) after registration until force restarting the app.

jeremymasters commented 4 years ago

Since this is the closest issue that I can relate to my problem, I'm mentioning it in here. Singal-Android does not receive messages(sent from another Android client) after registration until force restarting the app.

You should include a log from the app here right after that happens

Nisc3d commented 4 years ago

I have this same Problem with some of my contacts. When I send them a message, it shows one checkmark, so it's delivered to the server. But only after about 5 minutes they receive the message (2 checkmarks). That happens several times a day. But most of the time it works normally. It is still annoying, when you are in a conversation and it happens. It cuts the conversation off, because the other person thinks you didn't send anything as reply. I alrady made sure they had all battery optimisations disabled (with the guide), but it still happens.

It is rare, that I am the person, who gets the messages late, but today it happened again and I captured a debug log after I noticed it: https://debuglogs.org/559cea01cc8a0dc81b2e6bdd137bcbc7fd227ab48742a53d816834654fe39795 After about 2020-06-15 14:16:19.680 MESZ I get several delayed messages (I hope that is the right row, I am bad at reading debug logs). My Phone is a Asus Zenfone 6 and I also have every battery optimisation disabled (the one by Android and the one by Asus).

I hope this issue will be resolved sometimes in the future, because conversations sometimes don't feel as "fluid" as on other messengers.

Edit: Also the debug log has other exceptions, I don't know if they are relevant

greyson-signal commented 4 years ago
2020-06-15 14:16:19.680 MESZ I FcmReceiveService: FCM message... Delay: 726449

I'm guessing that's your problem, which is that it took ~12 minutes after the server sent a push notification for your phone to tell Signal about it. This is a very tricky space, because every phone manufacturer likes to put in different optimizations about push notifications. They could be doing weird stuff despite the fact that you turned off battery optimizations. They could be giving special treatment to specific messaging apps that they know are popular. It's impossible to say. But we are still doing research in this space to try to figure out what's happening.

morphine00 commented 4 years ago

Hi, adding more data to this issue.

I have a OnePlus 7T and I have battery saving for Signal disabled, and background data enabled. I'm getting delayed messages as well, even though the phone always has Wi-Fi or 4G available.

Day in question is 2020-08-30. I got a message at close to 2AM (around the 01:50 block of log lines, I think) that was originally sent at 00:16.

https://debuglogs.org/0302644cb55eab1ce5f50f8df62eef69487f3f1fdb83276784a900af436b00b0

Janfel commented 4 years ago

Hello, also adding more data.

I have a Samsung Galaxy A5 2017 with battery saving disabled in general and for Signal specifically. The Signal version is 4.70.5.

The date is 2020-09-05/06, the message has been sent at 14:45:16 into a group chat of four people and received at 00:00:14, right after an alarm set for 00:00 went off. The phone was connected to WiFi for the entire duration and I even sent a message for which I received the reading status in real time.

Link to the log: https://debuglogs.org/ec3e2bea1a6a1c8887f415dafbfad22e4a847ec48ca3d9d049b295ba7524684d

FaizKhan5 commented 4 years ago

Messages not receiving, no notifications unless i open an app.Every optimization for stopping signal is off

https://debuglogs.org/3a8c207e641e7944cbe25603b4ed53582aaa099ce08a5c4a354e115be35ad1ee

FaizKhan5 commented 3 years ago

Only solution is to lock Signal in Task View it works on OPPO devices.

vertigo220 commented 3 years ago

Just a thought, not sure if it would help, but for those having the issue even with battery optimization disabled for Signal, a couple things to try would be to see if it happens with the phone plugged in, to check if it is indeed related to that or some separate issue (though this could be tough if it's an intermittent issue), and try disabling optimization for the normal default SMS app, which would probably be Google Messages or possibly Samsung's/etc version. Maybe something with how they set up battery optimization keeps it optimized for handling incoming messages based on that.

nquijano commented 3 years ago

I have noticed it happening with my lady : she does NOT update apps often, and I'm on the Android Beta while she's not. One thing I may have empirically noted is that certain souped up VPNs seem to noticeably contribute to the phenomena : the dVPN offerings like Sentinel, Tachyon, etc. ProtonVPN in sec core or Tor mode My 0.002 Can cents

nah95 commented 3 years ago

Hi, adding more data to this issue.

I have a OnePlus 7T and I have battery saving for Signal disabled, and background data enabled. I'm getting delayed messages as well, even though the phone always has Wi-Fi or 4G available.

Day in question is 2020-08-30. I got a message at close to 2AM (around the 01:50 block of log lines, I think) that was originally sent at 00:16.

https://debuglogs.org/0302644cb55eab1ce5f50f8df62eef69487f3f1fdb83276784a900af436b00b0

Same device here. Messages are delayed by up to 2 hours some times. Desktop app works fine.

Also, after a multi message conversation on the desktop, the messages on the phone start trickling in some time later with no apparent pattern.

Debug log attached. https://debuglogs.org/32c26ba89666f4208f55023a26a700bd557146d638d3687e2340aca784bd9191

ColonelPanic-42 commented 3 years ago

A workaround for this issue is to use the fallback background websocket connection which doesn't seem to suffer from this problem. I was just about to give up on Signal until I found this, now it's made it usable again (despite what the FAQ says about this supposedly being less reliable).

  1. Uninstall Signal
  2. Disable Google Play services in the apps list (you''ll probably now get a TON of error popups every second or two until it's reenabled, but just cancel them)
  3. Reinstall Signal using the APK from the Signal website and open (it should add a persistent notification with "Background connection enabled")
  4. Reenable Google Play services to stop the errors and make everything else work again

As of now, Signal won't revert back to using Google Play services unless it's reinstalled, so it should persist using this workaround even when it's updated.

nah95 commented 3 years ago

With the influx of new Signal users recently, this bug has become even more frustrating as of now.

Another debug log.

https://debuglogs.org/9a07dfd7110f6e238dacd63c63823bf84997a309568675053028f3ed7d88d122

metal3d commented 3 years ago

Some of my contacts complain about this too. We are trying without battery optimization.

NullDepot commented 3 years ago

I have the issue listed in issue #10065 where notifications aren't received at all until the app is in the foreground. Would love to fix the problem as Signal is pretty much unusable if I don't receive notifications.

Here's another debug log to hopefully help find the issue. I'm running GrapheneOS so I don't run Google Play services and censored: true.

https://debuglogs.org/7a95ff663fb26e43907a62ea9f69e1d834ec2508793edcd75ca787cea21b0499

015203087630 commented 3 years ago

fbl--23456696--@mail003.ashampoo.com

015203087630 commented 3 years ago

Am 19.01.2021 10:00 schrieb "NullDepot" notifications@github.com:

I have the issue listed in issue #10065 where notifications aren't received at all until the app is in the foreground. Would love to fix the problem as Signal is pretty much unusable if I don't receive notifications.

Here's another debug log to hopefully help find the issue. I'm running GrapheneOS so I don't run Google Play services and censored: true.

https://debuglogs.org/7a95ff663fb26e43907a62ea9f69e1d834ec2508793edcd75ca787cea21b0499

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

015203087630 commented 3 years ago

8692 Am 19.01.2021 4:50 PM schrieb "015203087630" notifications@github.com:

fbl--23456696--@mail003.ashampoo.com

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/signalapp/Signal-Android/issues/8692#issuecomment-762932105, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHUK76KAWQ5R2XD2A6FZIOLS2WS3LANCNFSM4G7IHWQA .

rattkin commented 3 years ago

As soon as I disabled the "adaptive battery" feature completely, i received a batch of signal messages. Seems like the culprit. Why WhatsApp didn't have this problem?

Tursko commented 3 years ago

As soon as I disabled the "adaptive battery" feature completely, i received a batch of signal messages. Seems like the culprit. Why WhatsApp didn't have this problem?

You need to turn off any battery optimizations that are set on Signal. It doesn't happen to WhatsApp because OEMS will whitelist the app. Signal isn't typically whitelisted. Setting the app as your default typically disables the battery optimizations too.

rattkin commented 3 years ago

As soon as I disabled the "adaptive battery" feature completely, i received a batch of signal messages. Seems like the culprit. Why WhatsApp didn't have this problem?

You need to turn off any battery optimizations that are set on Signal. It doesn't happen to WhatsApp because OEMS will whitelist the app. Signal isn't typically whitelisted. Setting the app as your default typically disables the battery optimizations too.

I tried turning off app optimization, but the option is greyed out for signal. I had to do it for other background apps (package tracking etc) but never was it greyed out and unavailable.

vertigo220 commented 3 years ago

I've finally all but given up on it and switched back to Messages since only a couple people I communicate with even use Signal, so it's almost useless anyways for the privacy benefits, and lately it's been really bad about sending messages. First, it started pretty regularly showing messages sent to the person I primarily text with Signal-to-Signal as sent but they wouldn't show as received for hours. Keep in mind this is someone I've texted a lot with for the past probably 4-5 years using Signal, and only recently did it start doing this, and it's doing it quite a bit now. Then, what really did it for me and made me throw in the towel was when I spent an entire day trying over and over to send a message with a GIF and it kept failing, then finally I tried with Messages and it went through immediately.

Vikingtons commented 3 years ago

I feel as though I've been experiencing this for a couple years now with a certain number of contacts on Signal. It's not as if notifications aren't coming through, however. I'd get notified via fitness tracker / Signal Desktop, but notifications for the Android app will often fail to display until you open it, or they'd be subject to a substantial delay.

paulverbeke commented 3 years ago

My family and I all have a oneplus. They're pretty aggressive regarding background app to improve battery life. This site list every phone manufacturer and give them a grade based on how often they kill background app. They also provide instructions to disable these behaviors on each manufacturer. I applied these instructions and everything is fine now. https://dontkillmyapp.com/

Signal also have a support page regarding troubleshooting notifications problems, with essentially the same content but it feels not as organized (regarding which workaround is available on which phone and which os version) and not completely up to date. Maybe I'm wrong here, but it's only after reading donkillmyapp that I understood that I had missed one or 2 settings. https://support.signal.org/hc/en-us/articles/360007318711-Troubleshooting-Notifications#android_notifications_troubleshooting_phone

tarique1988 commented 3 years ago

I know for a fact that this problem is still prevalent on Oppo A3S. And since most comments are from oppo and OnePlus users, I guess that's what requires focus? My device is a Moto Fusion+ One, I experienced this issue but it was gone after I disabled battery optimization for signal. Not experiencing any such issue with any other app, so it's probably a bug hiding in plain sight.

fummymint commented 3 years ago

Let's face it, Signal will never be able to fix this problem. I had this problem since 2019 and it never got fixed. If you have this problem despite applying the troubleshooting steps, then your only real solution is to switch to iphone signal or just use plain SMS. This is beyond Signal dev's ability and Google is purposely doing this to punish people using privacy apps like Signal.

rattkin commented 3 years ago

It was fixed for me about 6 months ago. I don't know if it was a signal update, or that I removed the stock sms app and let Signal handle my sms.

On Sat, Aug 28, 2021 at 6:42 AM fummymint @.***> wrote:

Let's face it, Signal will never be able to fix this problem. I had this problem since 2019 and it never got fixed. If you have this problem despite applying the troubleshooting steps, then your only real solution is to switch to iphone signal or just use plain SMS. This is beyond Signal dev's ability and Google is purposely doing this to punish people using privacy apps like Signal.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/signalapp/Signal-Android/issues/8692#issuecomment-907567003, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG6GAGUSTOB24VTV62BEHLT7BSK7ANCNFSM4G7IHWQA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.