Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

NO more notifications at all, strange behaviour #3162

Open
UralZima opened this issue May 14, 2019 · 14 comments
Open

NO more notifications at all, strange behaviour #3162

UralZima opened this issue May 14, 2019 · 14 comments

Comments

@UralZima
Copy link

Hi. It is not duplicate of #3138, I have more detailed description and strange behaviour, which may help resolve this issue.

After matrix.org incident, I installed my own server, latest matrix-synapse. All worked fine, but only one device stopped to receive notifications at all. Other 3 (two IOS and one android exact same phone and OS) was working.

So we are talking about 2 android devices, ios seems to not have such issues.
They are both same hardware, same OS Lineage, same version without GCM, but with microg.
Both use riot latest versions from F-droid.
One had working notifications, one not. Reinstalling the app not helped.

Before matrix.org incident, they both worked perfectly!!!

2 days ago, the working android device also stopped to receive notifications!!! no background sync at all!!! So now two android devices not having notifications at all. Only when I click to app, it syncs with the server.

I think something changed in new riot.app version and broke this. Other apps can do background sync.

Please help, I urgently need to have notifications working again. Thanks for great work.

@geromueller
Copy link

Hi!

Same for me. No notifications at all. Android 9 (AEX) with microg and google play version, all troubleshooting checks pass! All other apps have working notifications.

@UralZima
Copy link
Author

Seems ios started to have same issues. Also, my riot crashes after every call...

@echto
Copy link

echto commented May 15, 2019

It might be the latest version of synapse and not the client.

@geromueller
Copy link

Yes, i just installed 0.99.4 and they work again! Maybe test a day or two before closing this ticket...

@geromueller
Copy link

No, even after the update the notifications only appear when the app is running...

@nakal
Copy link

nakal commented May 16, 2019

Maybe relevant. It appears to me as if the push infrastructure isn't working correctly, because I have delivery delays up to 15min for my homeserver.

@UralZima
Copy link
Author

At my side, I use the docker version of synapse and did not updated it since install. I have
installed it right after matrix.org incident. One android was receiving
notifications, one not. Now both androids and ios don't receive any
notifications and calls. After call, riot often crashes.

@kingwap99
Copy link

It might be the latest version of synapse and not the client.

yes, in my case.
both ios and android before update synapse to 0.99.4
only android 4.4 can have notification,
ios, android 6, 9 no

but after I updated synapse to 0.99.4
even android 4.4 cannot have notification

@geromueller
Copy link

These might actually be related: #3192 and microg/GmsCore#845

@UralZima
Copy link
Author

Hello. As I understood, new versions from F-DROID (microG) don't have background service code anymore, it don't ask for a permission, so that's why it is not working. Because of this, I am using version 0.8.26, which still have background service code... The downgrade was painful, needed to recreate all keys, verify again with everyone, because on android downgrade is not possible, only uninstall and install again.

Now I have another problem... I can't call anymore to IOS users. It seems they upgraded to latest versions, and connection never establishes.
Do new versions have this background service code back? or riot-foss is totally broken and depend from google??? Can I safely upgrade and have notifications working?

@Gigadoc2
Copy link

The OSS buid of Riot on F-Droid comes without GCM/FCM support. This is intentional and (probably, I am also just a user) two reasons:

  1. To use GCM/FCM, the app has to include the corresponding libraries from google, which are non-free, so the main F-Droid repo will not distribute them. While microG provides an open-source alternative to the Play Services for an Android itself, I do not know of a free re-implementation of the FCM libraries.
  2. Not everyone using F-Droid is using mircoG. If the F-Droid version of Riot were built with the GCM/FCM libraries, all those users could not even start it.

As far as I can tell, the F-Droid version of Riot instead periodically connects to the homeserver to check for new events. I have not used the current F-Droid version (using the Play Store one with microG), but the last time I did it already did not request background permission. Instead it looks (I have not checked the code) like it is using the Android Job scheduler to get started periodically and then opens a notification to not get closed until the synchronization finishes.
This means it can work without the special background permission, but the messages will come in with a delay, for me it was approximately 30 minutes in the mean.

The thing is, protocols like XMPP (Conversations) or IMAP (Email) use long-lived TCP sockets, so the non-GCM/FCM version of such apps can ask for the background permission, open a long-lived TCP connection and then receive notifications instantly. If the XMPP or Mail server is set up properly, this does not even take that much battery.
However, Matrix uses an HTTP API for connections from the Clients to the Homeserver. So, AFAIK there is no way to open a long-lived connection and thus no way for instant notifications without push notifications.
I don't want to blame Matrix here though, it is not a solution for every app to invent their own push notification alternative (and it would not scale, at some point you would have so many keepalives from different TCP connections that the phone could not go to sleep anymore). It would probably be best if there was a standardized alternative to FCM for push notifications, so that Play Store builds would just link against google services while free builds link against this alternative. But someone would have to write that...

To get back from that tangent to the missing notifications:
If the F-Droid version of Riot works as I suspect, then it is entirely at the mercy of Android when it comes to when it can sync (or whether at all). With default Android behavior (so, LineageOS) this means that you have to open the app manually from time to time, or Android will consider it "unused" and not schedule it anymore. The battery saving mode may also prevent Riot from being scheduled until you start it manually, etc.

@UralZima
Copy link
Author

Well, no need to implement GCM/FCM in f-droid version. Please just keep the old behaviour, as in version 0.8.26. It was synced every N seconds without any keep-alive, and worked perfectly, with no battery drain. I use 30 sec for sync and it is fine for me. Why this code was removed?
Because of this I am stalled with this version and can't upgrade, I need nearly-insant notifications, not 30 minutes like you mentioned. Configurable time for background sync is the best for f-droid version. With background permission.

Right now the version 0.8.26 can't establish calls anymore with updated ios clients... I don't know what to do. Using Signal as failover.

I hope the old code with background permission and background sync every N seconds will be back and we will close all riot-fdroid notifications issues.

I found about version 0.8.26 in this issue #3122 and people confirming it.
Please please please put back permanent background service.
Thanks

@mcg-matrix
Copy link

As far as I can tell, the F-Droid version of Riot instead periodically connects to the homeserver to check for new events.
[...]
The thing is, protocols like XMPP (Conversations) or IMAP (Email) use long-lived TCP sockets, so the non-GCM/FCM version of such apps can ask for the background permission, open a long-lived TCP connection and then receive notifications instantly. If the XMPP or Mail server is set up properly, this does not even take that much battery.

So why can't the F-Droid version of Riot ask for the background permission and periodically (re)connect to the homeserver? (I have no clue about Android internals, just a user asking.)

However, Matrix uses an HTTP API for connections from the Clients to the Homeserver. So, AFAIK there is no way to open a long-lived connection and thus no way for instant notifications without push notifications.

I can observe that "Riot Desktop" (installed from https://packages.riot.im on a Debian-stable system) is using a single long-living TCP connection when waiting for things to happen. Does it use an API different from the one used by the F-Droid version of Riot?

@dani
Copy link

dani commented May 6, 2020

I had the same issue (no push notifications on Android, playstore version. Both Riot and RiotX affected) and it took me quite some time to debug. The problem in my case was that I use an outbound web proxy globaly (http_proxy, https_proxy defined as http://my-proxy.local:3128 in /etc/systemd/system.conf). And synapse does not support this format. Those env vars must be defined as my-proxy.local:3128 (striping the scheme part). So if you have problems with notifications, you should check if those env vars are defined for your synapse process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants