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

Notification [Fdroid] Add a new mode for notification #3122

Closed
BillCarsonFr opened this issue Apr 17, 2019 · 13 comments · Fixed by #3155
Closed

Notification [Fdroid] Add a new mode for notification #3122

BillCarsonFr opened this issue Apr 17, 2019 · 13 comments · Fixed by #3155

Comments

@BillCarsonFr
Copy link
Member

New android versions have greatly limited usage of resources while in background, in order to save battery/memory usage.

In order to comply with this new model and good app behavior, the F-Droid app version is using WorkManager to schedule background sync. This mean that even if there is a guaranty that sync with home server will be performed, depending of the phone status and resource the sync can be deferred.

Some users still require that the sync are performed at a precise time in order to guaranty more real-time notifications.

A new option could be proposed to user of the Fdroid version, they could choose between:

  • Save as much battery as possible
  • Have notification ASAP (at the cost of battery/radio) [sync delay configurable]

This mode could require battery optim whitelisting to always keep a background service alive, or a permanent foreground notification. TBD

@vsatmydynipnet
Copy link

Thank you very much! This is definitely required, since the change Riot on Android is unusable for critical stuff. It worked so perfect in the past, now one needed to remove all critical notifications off from Riot. Would love to be able to move everything back to Riot.

@matoro
Copy link

matoro commented Apr 20, 2019

I have run into this as well. Notifications on F-droid Riot are crippled since the upgrade from 0.8.26 -> 0.8.28. Nothing is coming through at all anymore; downgrade to 0.8.26 solves the issue. Please restore a way for the persistent notification to be enabled!

@slq32
Copy link

slq32 commented Apr 24, 2019

Can't something like a websocket be used for notifications (non FCM mode) ? I think it would be more efficient then connecting every X seconds to the server and "pulling" new events ... Conversations / xmpp without FCM works very well and the impact on battery is zero (running in background allowed and excluded from battery optimisation). Polling the server every X seconds is quite inefficient and works quite bad with voice calls ...

@takiainen
Copy link

Conversations indeed works like a charm and consumes almost no battery at all. Makes me wonder why everyone hasn't adopted their strategy regarding notifications?

@slq32
Copy link

slq32 commented Apr 26, 2019

From what i see Conversations keeps a connection open to the XMPP server. You do have to allow background activity / exclude from battery optimization, but that's all. I suppose that for Riot a secure webocket can be kept open and the server can just notify the client that something happened (incoming message / call etc). The older version of Riot (0.8.26) does run in background, but it polls the server every X seconds, and that is extremely inefficient, it's very power hungry and that might be an issue for people with limited data plans too. A websocket does not need any data to be kept open unless needed.
The websocket is just an idea, i'm sure there are more options to this, but it's a much needed feature.

@UralZima
Copy link

it was working greate but broke, not working anymore at all. Please help resolving this #3162

@slq32
Copy link

slq32 commented Jun 5, 2019

Well yeah the notifications are totally broken on non-fcm builds, the client is unusable since persistent service notification was removed. Changing methods that work for methods that don't work is not a good thing, however the non-fcm version seems not to be too high on the priority list right now.

@UralZima
Copy link

UralZima commented Jun 5, 2019

Well. it is not hard to leave the code on non-gcm versions as it was. All was working perfectly, my background sync was at 25 sec and battery and anything was fine with this.
Now no any notifications, and crash after every call without reply.
If i'd knew about such policy, then I'd keep riot without update. I thought update - more improvements, bug fixes. but here new bugs, removed features... wtf...

Tell me the latest working non-gcm version where background-sync still working as it was. Please. If it is still avalilable for download.

@slq32
Copy link

slq32 commented Jun 5, 2019

You can pull the sources for 0.8.26 and build it yourself, that will work. But you will be missing the newly added features ....

@UralZima
Copy link

UralZima commented Jun 5, 2019

Thanks for the info. One removed feature is better than many newly added features...)
you mean crash after every call - this newly added feature? :D

@slq32
Copy link

slq32 commented Jun 5, 2019

I don't know about the crash after call, i did not have that problem, however the missing notifications is a major issue.

@UralZima
Copy link

UralZima commented Jun 5, 2019

The crash is happening when the call is unanswered. After that, it closes and offers to restart. If I click restart, it opens and all messages appear 'Can't decrypt message'. Then I close it again, open again and messages displays normally. If call is answered, all fine.

@UralZima
Copy link

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?

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

Successfully merging a pull request may close this issue.

7 participants