Android-DataBackup
Android-DataBackup copied to clipboard
[Bug] Restoring from WebDAV - full reload is triggered each time the Apps list is opened
Describe the bug A reload is triggered each time the Apps page is opened, even when the previous reload has not finished. This leads to high network and CPU load on the WebDAV server.
To Reproduce Steps to reproduce the behavior:
- Start monitoring WebDAV server (Nextcloud) logs
- Go to 'Restore'
- Click on 'Cloud'
- Click on 'Apps'
- Click on the first app (view 'Details')
- Click on the back button
Expected behavior A new reload should not be started if the previous reload has not finished.
Logs
After step 4, Nextcloud logs show a sequential queries:
172.18.0.3 - user 27/Jul/2024:16:50:05 +0100 "PROPFIND /remote.php" 207
172.18.0.3 - 27/Jul/2024:16:50:05 +0100 "PROPFIND /remote.php" 401
172.18.0.3 - user 27/Jul/2024:16:50:05 +0100 "PROPFIND /remote.php" 207
172.18.0.3 - 27/Jul/2024:16:50:06 +0100 "PROPFIND /remote.php" 401
After step 6, Nextcloud logs now show 2x queries:
172.18.0.3 - user 27/Jul/2024:16:50:19 +0100 "PROPFIND /remote.php" 207
172.18.0.3 - user 27/Jul/2024:16:50:19 +0100 "PROPFIND /remote.php" 207
172.18.0.3 - 27/Jul/2024:16:50:20 +0100 "PROPFIND /remote.php" 401
172.18.0.3 - 27/Jul/2024:16:50:20 +0100 "PROPFIND /remote.php" 401
If steps 5 & 6 are repeated, Nextcloud logs show 3x queries and so on, with high CPU load on the server hosting Nextcloud.
The built-in logs do not reveal much, other than the icon file being downloaded each time the Apps list is opened.
2024-07-27 16:49:50.117 CloudRepository Downloading...
2024-07-27 16:49:50.121 SHELL_IN ls -Zd "/data/user/0/com.xayah.databackup.foss/files" | awk 'NF>1{print $1}'
2024-07-27 16:49:50.170 SHELL_OUT u:object_r:app_data_file:s0:c148,c256,c512,c768
2024-07-27 16:49:50.171 SHELL_CODE 0
2024-07-27 16:49:50.171 SHELL_IN chcon -hR "u:object_r:app_data_file:s0:c148,c256,c512,c768" "/data/user/0/com.xayah.databackup.foss/files/"
2024-07-27 16:49:50.210 SHELL_CODE 0
2024-07-27 16:49:50.210 SHELL_IN chown -hR "10148:10148" "/data/user/0/com.xayah.databackup.foss/files/"
2024-07-27 16:49:50.251 SHELL_CODE 0
2024-07-27 16:49:50.252 WebDAVClientImpl download: https://nextcloud.lan/remote.php/dav/files/user/backup/configs/icon.tar to /data/user/0/com.xayah.databackup.foss/files/DataBackupTmpDir/icon.tar
2024-07-27 16:50:15.847 CloudRepository Downloading...
2024-07-27 16:50:15.852 SHELL_IN ls -Zd "/data/user/0/com.xayah.databackup.foss/files" | awk 'NF>1{print $1}'
2024-07-27 16:50:15.896 SHELL_OUT u:object_r:app_data_file:s0:c148,c256,c512,c768
2024-07-27 16:50:15.897 SHELL_CODE 0
2024-07-27 16:50:15.898 SHELL_IN chcon -hR "u:object_r:app_data_file:s0:c148,c256,c512,c768" "/data/user/0/com.xayah.databackup.foss/files/"
2024-07-27 16:50:15.938 SHELL_CODE 0
2024-07-27 16:50:15.939 SHELL_IN chown -hR "10148:10148" "/data/user/0/com.xayah.databackup.foss/files/"
2024-07-27 16:50:15.981 SHELL_CODE 0
2024-07-27 16:50:15.982 WebDAVClientImpl download: https://nextcloud.lan/remote.php/dav/files/user/backup/configs/icon.tar to /data/user/0/com.xayah.databackup.foss/files/DataBackupTmpDir/icon.tar
Smartphone (please complete the following information):
- Device: Xiaomi K20 Pro
- OS: LineageOS 20
- Version 2.0.3
Additional context Latest Nextcloud Hub 8 (29.0.4) running on Docker with caddy as the reverse proxy Total number of backed up apps: 71 Time taken for a full reload: 3-4 minutes