android icon indicating copy to clipboard operation
android copied to clipboard

New Autoupload feature kills battery

Open maybeageek opened this issue 7 years ago • 58 comments

Actual behaviour

-After the rewrite of the autoupload feature, autoupload stopped working. Configuring it new, working as expected. However, it kills the battery in a matter of hours. 100% to 1% in 3-5h. This didn't happen in the previous version

Expected behaviour

-Tell us what should happen Battery should last longer

Steps to reproduce

Environment data

Android version: 6.0.1 (Samsung A3 2017, Stock) 7.1.1 (Galaxy S4 - LineageOS) Device model:

Stock or customized system:

Nextcloud app version: newest. Nextcloud server version: 11.0.2

Logs

Web server error log

Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Insert your Nextcloud log here

maybeageek avatar Mar 26 '17 21:03 maybeageek

Same issue

DigitalElement99 avatar Mar 30 '17 16:03 DigitalElement99

Hi. I'm experiencing similar symptoms on my Cat S60 running Android 6.0.1. Ever since I upgraded to the latest version of the Nextcloud Android app (1.4.2) the highest battery consumer each day has been nextcloud. I have multiple folders selected for auto upload, maybe that can influence it?

SigLinJo avatar Mar 31 '17 16:03 SigLinJo

I personally experienced that problem with just one folder selected, the main camera folder.

DigitalElement99 avatar Mar 31 '17 18:03 DigitalElement99

Do you have enabled nextcloud sync on android system settings -> accounts -> nextcloud?

tobiasKaminsky avatar Apr 03 '17 09:04 tobiasKaminsky

Do you have enabled nextcloud sync on android system settings -> accounts -> nextcloud?

no, this setting is disabled for me.

maybeageek avatar Apr 03 '17 11:04 maybeageek

It was disabled for me too. I just activated it now and will report back if there is any change in a day or two. Thanks for looking in to this! Love what you are doing with the app! To be able to upload from more folders is amazing!

SigLinJo avatar Apr 03 '17 21:04 SigLinJo

Same issue. Samsung Galaxy S7 Edge with Android 7.0. The samsung system is identifying Nextcloud every day as the only app draining the battery and ask me if I want to put it in sleep mode.

snicke avatar May 14 '17 20:05 snicke

Autoupload drains my battery, too. Stock 7.0 on Galaxy S6.

CroneKorkN avatar Jun 06 '17 11:06 CroneKorkN

Hi, Same issue here : Nextcloud draining battery on Galaxy s7 android 7.0. The samsung system is identifying Nextcloud every day as the only app draining the battery and ask me if I want to put it in sleep mode.

Doloros avatar Jun 26 '17 14:06 Doloros

Dear users,

thank you for your patience. After lots of work, we’re super excited to be able to give you a test version with new auto upload implementation. Keep in mind we will only accept bugs related to Auto Upload in this APK, as other things might be broken.

https://cloud.nextcloud.com/s/ftZraTruRQjTe0R

This is a dev APK so it will not overwrite your existing play store/f-droid APK unless you’re already running dev version. Also, you might need to remove your existing dev version before installing this one.

Explanation of the current functionality:

  • added support for custom folders
  • separated image and video folders
  • checks for new files happens every 15-20 minutes
  • automatic retry every 15-20 minutes or when you force close/open the app
  • automatic pause once network is changed (untested!)
  • significantly less battery usage

All and any testing is more than appreciated, especially with large and ever-going files like Videos. (like, try to record a 30 min video).

Let me know if you’ve got any questions.

Cheers, Mario

mario avatar Jul 26 '17 08:07 mario

I installed this dev app. But now my auto upload has stopped working. I enabled The sync in the android account settings. Not working. I taken some photos and videos. Switched off the phone and waited a bit. But it does not upload anything :(

aPollO2k avatar Aug 18 '17 11:08 aPollO2k

@aPollO2k which version have you installed? There is now a release candidate for the upcoming version available at beta channel on google play store: https://play.google.com/apps/testing/com.nextcloud.client

Please try this one as this includes the latest fixes.

tobiasKaminsky avatar Aug 18 '17 12:08 tobiasKaminsky

I'm having the same issue, and am running 2.0.0 (seems beta and production versions are the same, I wasn't upgraded after joining the testing program).

I'm getting constant warnings it's draining over 1% of my battery per hour. And the only thing I want the android app for is auto uploading my pics.. Any update on a fix for this?

shanness avatar Dec 29 '17 09:12 shanness

I also must confirm, since 3.0.1, upload seems to drain battery. Problem with android 8.1 on Nexus 6p.

olenz avatar Feb 27 '18 17:02 olenz

Upload or the notification that's persistently there?

mario avatar Feb 27 '18 17:02 mario

@olenz same on Samsung s8

zdichev avatar Mar 27 '18 19:03 zdichev

Still draining the battery on Galaxy S7 Edge. Taking 10% of the battery usage in the current use cycle for instance according to battery usage stats. No other app even close. Screen and Android System only processes using more battery (16 and 13% respectively).

screenshot_20180412-163024

screenshot_20180412-162647

msundin avatar Apr 12 '18 14:04 msundin

Same here

gubagu avatar Apr 12 '18 17:04 gubagu

Any progress on this? Unfortunately I need to uninstall and stop using the app. Draining my battery very fast. The same with my partners phone.

msundin avatar May 26 '18 15:05 msundin

This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

stale[bot] avatar May 10 '19 02:05 stale[bot]

Nextcloud is draining my battery too.

r2p2 avatar Jul 04 '19 06:07 r2p2

Same problem here... I am using Wakelock Detector on a Stock ROM of a Galaxy S7 to monitor battery usage.

3h45m after turning on my phone, the Nextcloud app was active for 35m11s. No other app is remotely close to the Nextcloud app's runtime. The second app in line ran for 36s during that time. The battery is down to 87% while the phone was sitting idle on my desk.

edit The phone battery was at 100% when it was turned on.

Rayn0r avatar Jul 08 '19 15:07 Rayn0r

I am testing right now with a S5 Neo with Wakelock Detector if and how often our app requests wakelock.

tobiasKaminsky avatar Jul 23 '19 10:07 tobiasKaminsky

@Rayn0r this is strange. According to our code we do not acquire wake lock if the device is at least Lollipop (Android 5.0).

What exactly is it in WakeLock Detector?

  • Screen WakeLock
  • Cpu WakeLock
  • WakeUp Trigger?

tobiasKaminsky avatar Jul 23 '19 10:07 tobiasKaminsky

I let the phone sit on my desk this morning again. This is a screenshot of the CPU Wakelock: image

Rayn0r avatar Jul 25 '19 07:07 Rayn0r

Still draining the battery on Galaxy S7 Edge. Taking 10% of the battery usage in the current use cycle for instance according to battery usage stats. No other app even close. Screen and Android System only processes using more battery (16 and 13% respectively).

screenshot_20180412-163024

screenshot_20180412-162647

Any update on this? Now, almost 2 years later, I'm on a Galaxy S10 with Android 10 and Nextcloud auto upload is still (!) draining the battery pretty much like in the picture above. I auto upload both camera images, videos etc. but also custom folders like WhatsApp images. I have the setting to only auto upload when charging and on wifi, still Nextcloud is draining my battery all day long. Why? It should only be activated when plugged in and on wifi.

Only way to stop the battery drain is:

  1. Enable battery optimization for the Nexcloud app in Android (i.e. don't let Nextcloud run in the background) but then the auto upload obviously never starts when you plug in the charger.
  2. Disable auto upload

I think the solution here is to find the issue in the code that makes the Nextcloud app check for uploadable items all the time (keeping the phone awake) even if it should only do so when charging according to the user settings. In pseudo code just to clarify what I'm meaning:

If (notCharging && onlyAutoUploadWhileChargingUserSetting) {
    skipCheckForFilesToAutoUpload = true;
}

Then the battery should probably not drain.

msundin avatar Jan 09 '20 14:01 msundin

I can't believe this bug is still open after three years. Every now and then I try the Nextcloud app, and always I give it up because it kills the battery (several Samsung phones running LineageOS). However, the only WebDAV sync alternative (FolderSync) for Android is kind of dead, so the need for a client gets more urgent.

As mentioned above, even using restrictive conditions for upload does not help, as Nextcloud seems to start nevertheless if any media is changed on the configured folders.

I would even go with a periodic sync or a manual sync (controllable e.g. by Tasker) if it is not possible to restrain the battery usage of the app itself.

Ra72xx avatar Feb 28 '20 04:02 Ra72xx

Looks like guys are short handed if even after three years bug is still open :( 47% battery drain in a day. For now I see - only one option:

  • disable entirely autoupload and background tasks
  • use alternative sync app

kem-a avatar Jun 08 '20 19:06 kem-a

@xdaWhitealien

  • disable entirely autoupload and background tasks

I can't find such an option in the app. Can you explain how to do this?

  • use alternative sync app Can you recommend one?

VietTralala avatar Jul 29 '20 17:07 VietTralala

How many files are getting uploaded? Roughly how many files do you have on your device? It might be that scanning takes too long.

I would need one person who is suffering from this, and is willing to test a few apks and give me logcat info.

tobiasKaminsky avatar Nov 25 '20 08:11 tobiasKaminsky