mihonapp / mihon

Free and open source manga reader for Android
Apache License 2.0
9.78k stars 442 forks source link

Mihon rapidly drains battery in background #557

Open Xian-beep opened 6 months ago

Xian-beep commented 6 months ago

Steps to reproduce

  1. Leave Mihon running with smart update disabled and automatic updates enabled.
  2. Battery starts to drain rapidly in background after a automatic library update is issued.
  3. Check the "Worker info" pane under "Debug Info", it will act strange (attached video).
  4. If you force quit the app, battery drain disappears until the next automatic library update.

Expected behavior

Battery should not abnormally drain in the background.

Actual behavior

Mihon is constantly running in the background and draining battery after a library update.

Crash logs

Video example where the issue is present:

https://github.com/mihonapp/mihon/assets/83923843/d72f5bb8-037a-464f-9cc5-22fe2e1f4f84

App version: 0.16.4 (standard, a4f5dfa, 5, 2024-02-26T16:26Z)
Android version: 14 (SDK 34; build lineage_dumpling-userdebug 14 UQ1A.240205.004 eng.root.20240305.200910 dev-keys)
Device brand: OnePlus
Device manufacturer: OnePlus
Device name: OnePlus5T (OnePlus5T)
Device model: ONEPLUS A5010
WebView: Android System WebView 122.0.6261.90

Mihon version

0.16.4

Android version

LineageOS 21 (Android 14)

Device

OnePlus 5T

Other details

No response

Acknowledgements

Smol-Ame commented 6 months ago

This is probably because you disabled Smart Updates, which helps reduce unnecessary titles from being updated on every Library Update, and instead of spreading out your updates to predicted release patterns, it's unnecessarily checking those titles every Library Update.

Turn it back on to reduce the amount of titles needing to update, the amount of requests & traffics sent to sources, the background battery drain from all the unnecessary requests, and to speed up/free the phone up from the large process of updating all your titles.

You are even aware of the issue yourself, knowingly or unknowingly, since you said it yourself: " ...battery drain disappears until the next automatic library update"