-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Avoid checking for walled connection until necessary #10448
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10448 +/- ##
=========================================
Coverage 31.32% 31.32%
Complexity 3235 3235
=========================================
Files 536 536
Lines 39712 39712
Branches 5477 5477
=========================================
Hits 12438 12438
Misses 25430 25430
Partials 1844 1844 |
hey, i appreachiate that work and vote this up (untestet). the battery drain is mostly not caused by changed files, but especially in the case, where e.g. autouploaded pictures have been deleted before syncing them. they will get state "file not found" in uploads and the syncworker checked the internetwalled for each file. as the error will persist this will happen for each deleted picture every sync until the upload queue has been cleared. Does your pull consider these deleted files to not cause pings any more? |
Yes, FILE_NOT_FOUND is handled separately and will not cause a ping. |
Actually, not that sure, because this PR only changes things offline sync, not for autoupload; that should be changed separately |
Handled in c9be796. Will reword this PR to make this explicit. |
tested it: made a picture in offline-mode. picture folder is set to upload only if wlan is free/available. Got connection error shown as message and in upload queue. @AlvaroBrey could you check to see if this error affects your setup too? |
That is also the behaviour in master, so it's not something introduced in this PR |
/rebase |
…ss sync fails Co-authored-by: obel1x <obel1x@web.de> Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
…ssible moment This avoids network calls if the uploads can't be done for other reason (such as missing files) Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
c9be796
to
c8aa577
Compare
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/10448.apk |
Both when syncing offline files and when retrying failed uploads, don't check for walled internet until the moment it's needed, thus avoiding network calls in cases where it's not needed (missing files, or other conditions not met)
This should reduce load on server, data consumption, and battery drain in such cases.
This is a successor to #10087 with a slightly different approach, thanks @obel1x for your findings and ideas.
In the future we might consider removing this check completely as it is a source of problems, and just handle the errors when trying to do operations in a walled network.