Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major battery drain when notifications enabled #126

Open
1 task done
Toasterbirb opened this issue Aug 27, 2022 · 29 comments
Open
1 task done

Major battery drain when notifications enabled #126

Toasterbirb opened this issue Aug 27, 2022 · 29 comments
Labels
bug Probable bug help-wanted Good contribution opportunities upstream This is an issue in Signal, should be reported to Signal-Android

Comments

@Toasterbirb
Copy link

Toasterbirb commented Aug 27, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Bug description

As seen in the image, Molly tops the battery usage chart by a big margin
battery_usage

Usually the first day or two are fine, but then the battery usage ramps up. This same issue also happened with the upstream Signal version and that was the main reason I actually moved to the FOSS Molly version. I think adding unified push as an option might be one solution.

Steps to reproduce

  1. Install LineageOS without GAPPS
  2. Install Signal or Molly
  3. Enable notifications for Signal / Molly

Expected result: A bit more background battery usage compared to doing notifications trough Googles notification system
Actual result: Major battery drain that in some cases can even prevent the phone from charging properly

Molly version

v5.44.5-1-FOSS

Android version

LineageOS 19.1

Device

Fairphone 3

Link to debug log

https://debuglogs.org/android/5.44.5/4300b088ee0dd65914037cc68f00e501434315c0cf59f6ec3cc4aef57c5606a1

@valldrac valldrac added bug Probable bug upstream This is an issue in Signal, should be reported to Signal-Android labels Aug 27, 2022
@jordischoots
Copy link

I'm experiencing exactly the same issue.

@SrEstegosaurio
Copy link

Same here. Saddly I cannot provide any metrics/info due to my phone. But I noticed the impact on battery.

I have to confirm this, but I also belive that Molly could be causing my phone to have higher temperatures.

I'm using Molly-FOSS (Latest version.) running on Android 10.

Thanks for all your work! ❤️

@XMA2l
Copy link

XMA2l commented Sep 13, 2022

Just found this app and wanted to try but now i dont.
I use the official auto updating apk without gcm, persistent notification, no problem here, A10, lineage os, no gapps, no microg, signal just used 14% battery since a long time (los says since last 100% charge, but cause i use ACC it never gets there).
Even F-Droid with 16% costed more battery.

Am i just using other apps way more excessively then anyone else here, or could my current version rlly have a better power management?

@Toasterbirb
Copy link
Author

The battery draining doesn't seem to be consistent. Sometimes the drain goes away and it goes back to normal rates of usage. I have no clue what variables to follow though to make any conclusions on what is causing this

@XMA2l
Copy link

XMA2l commented Sep 13, 2022

LibreSignal's fate incoming after this mention?^

@Toasterbirb
Copy link
Author

Are the Signal devs meant to be not aware about the existence of this fork?

@valldrac
Copy link
Member

They are aware of this project. There isn't any problem mentioning Molly to the Signal team.

@XMA2l
Copy link

XMA2l commented Sep 13, 2022

They are aware of this project. There isn't any problem mentioning Molly to the Signal team.

Awesome! Is there a thread somewhere for reading more details about this? Srry for the offtopic.

@drkhsh
Copy link

drkhsh commented Oct 27, 2022

Same here on my Pixel 6 with GrapheneOS without Google Play Services. Interestingly, on mobile data it is always worse than on Wifi.

@hialvaro
Copy link

How could battery usage for push notifications with websockets be improved?

@valldrac valldrac added the help-wanted Good contribution opportunities label Jan 24, 2023
@HarriBuh
Copy link

HarriBuh commented Jan 25, 2023

I'm on rooted Android 13 on Pixel 7 and have this issue as well. Could the increase in battery consumption just be the "real"/ "pure" one, while the apparent lower usage with Google's Firebase notification service is just "hidden" or concealed inside Google's Play Service own battery usage?
Because everything going on on Android will always pass through it..

TL;DR: The high usage of Molly's own notification service might be "true", while Google's own notification service might be "faked".

@githubyouser
Copy link

I'm also noticing that Molly is using WAY too much battery power. As others have mentioned, the issue seems to be somewhat sporadic, but recently seems to have grown worse. Happy to provide logs or troubleshooting if it will be helpful.

@adriandelgg
Copy link

Same here, Molly is destroying my battery life.
Screenshot_20230624-214048

@albirs
Copy link

albirs commented Jun 30, 2023

may this commit helps in this case:
signalapp/Signal-Android@13470fb

@jm355
Copy link

jm355 commented Jan 20, 2024

Can Molly bring in this pull request, to see if it does help with battery? signalapp/Signal-Android#13337

@matchboxbananasynergy
Copy link
Collaborator

Can Molly bring in this pull request, to see if it does help with battery? signalapp/Signal-Android#13337

The next release will include it. The person who made that PR also develops for Molly.

@Ronkn
Copy link

Ronkn commented Jan 20, 2024

Thank you so much for doing what signal refuses to do

@jayb-g
Copy link

jayb-g commented Jan 20, 2024

The next release will include it. The person who made that PR also develops for Molly.

Would be a huge relief if that fixes it.

@Bean-Beret
Copy link

Thanks everyone involved for trying to resolve the issue!

However, for a quick test, I built molly with the signalapp/Signal-Android#13337 patch included and it does not resolve the issue on a Fairphone 4 with /e/ OS 1.17. The issue seems unchanged: normal battery drain when on wifi, but extreme battery drain when on mobile network.

@valldrac
Copy link
Member

I built molly with the signalapp/Signal-Android#13337 patch

Yesterday we improved the patch, but haven't updated the pull-request yet. Use the beta we just released instead. It includes the latest commit 7257d57.

Don't expect miracles, but you should notice less consumption.

@wiesenklee
Copy link

I've experienced similar behavior on GraphenOS with Sandboxed Google Play Services and Molly's FOSS (Fdroid) version. Today I installed the latest non-FOSS version expecting Molly to drain way less battery now using FCM (Firebase Cloud Messaging). But it did not. So I restricted battery usage in Android's battery settings and noticed that my database encryption could not keep unencrypted. Could database encryption be a part of battery drain problem's?

@jayb-g
Copy link

jayb-g commented Apr 16, 2024

Could database encryption be a part of battery drain problem's?

Could definitely be. Since i'm experiencing similar battery usage where in one phone I have fresh setup of signal, in another I have 20+GB of data. Both signal apks and no play services. Unrestricted battery usage. Although the one with fresh setup uses way less battery. So the problem might be related to database handling and in upstream signal repo.

@jayb-g
Copy link

jayb-g commented May 3, 2024

Guys, using Molly-UP (or Signal-FOSS by twinhelix if he implements UP) and setting up your own mollysocket for free(visit mollysocket-fly repo) seems to be the only solution for now for the battery drain issue. I just set this up and will report back in a few weeks with an update on how it performs.

@48-mq
Copy link

48-mq commented May 13, 2024

@jayb-g Why does this require the setting up of an external MollySocket server? If the default one built into the app can serve WebSocket notifications why can't it serve UP notifications as well?

@jayb-g
Copy link

jayb-g commented May 13, 2024

@48-mq Because the default way of getting notifications(using websockets) in molly and in upstream signal is causing battery drain due to improper handling of WS commections or whatever reasons. UP addresses that and eliminates possibility of battery drain due to websockets.

I have seen no user reporting low battery usage even after the said fix for it patched in molly.

@jm355
Copy link

jm355 commented May 13, 2024

@jayb-g the websocket connection is inefficient, so mollysocket allows it to be handled by a server connected to power (where efficiency is less important) and forward the fact that there's a new notification to molly via an efficient notification listener - unifiedpush

@48-mq
Copy link

48-mq commented May 13, 2024

I had assumed Molly had built-in functionality to use its own MollySocket server, but not reviewing the Readme I realize that is not the case.

Why can't there be a public (airgapped) MollySocket server just available for everyone to use? The notifications are all encrypted anyway, and I can't image such a public server would consume so many resources that it would come at an exorbitant cost to the Molly community?

@jayb-g
Copy link

jayb-g commented May 14, 2024

the websocket connection is inefficient, so mollysocket allows it to be handled by a server connected to power (where efficiency is less important) and forward the fact that there's a new notification to molly via an efficient notification listener - unifiedpush

@jm355 I get that. But so why can't apps themselves use this efficient way of sending notifications to users? I believe apps are accustomed to not worry about notifications efficiency since they have been relying on Google and Apple for that from the beginning? And you need a single server anyway to get notifications from different apps efficiently(not having an open connection for each app)

@jayb-g
Copy link

jayb-g commented May 14, 2024

Why can't there be a public (airgapped) MollySocket server just available for everyone to use?

@48-mq yes you answered your own question. Molly is not Signal. It just uses signal backend which they don't have any control over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Probable bug help-wanted Good contribution opportunities upstream This is an issue in Signal, should be reported to Signal-Android
Development

No branches or pull requests