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

Daily backup of contacts and calendar not working #9632

Closed
Discostu36 opened this issue Dec 29, 2021 · 2 comments · Fixed by #9646
Closed

Daily backup of contacts and calendar not working #9632

Discostu36 opened this issue Dec 29, 2021 · 2 comments · Fixed by #9646
Assignees
Labels

Comments

@Discostu36
Copy link

Steps to reproduce

  1. Activate the daily backup of contacts and calendar
  2. Wait a few days
  3. Have a look at the backup folders

Expected behaviour

  • A daily backup should have happened and the date of the last backup should match with the information in the backup settings

Actual behaviour

  • No automatic backups happened. In the backup settings it says "Last backup: 4 hours ago" but the most recent file in .Calendar-Backup and .Contacts-Backup are four days old (that was a manually triggered backup)

Can you reproduce this problem on https://try.nextcloud.com?

I didn't try, but I guess this is a client problem, not a server problem

Environment data

Android version: 11

Device model: Fairphone 4 5G

Stock or customized system: Fairphone OS

Nextcloud app version: 3.18.1

Nextcloud server version: 20.0.11.1

@Discostu36 Discostu36 added the bug label Dec 29, 2021
@Discostu36
Copy link
Author

Today it worked. I think this is the problem: The app tries to always backup at the same time of the day. If the phone is offline at that moment, the backup doesn't work. But the app doesn't seem to care if it worked or not. It says that has done its backup in the settings and is finished for the day. What it should do is to either give an error message to the user or wait for connectivity and then retry.

@EmperorArthur
Copy link

Sorry for my ignorance in responding, but I was skimming through this project and noticed some useful things that are related. Note I haven't looked at the code, and just the big overview issues, so this is sort of a guesstimate of a road map.

I'd say first thing to look at is to actually check the backup status instead of the job start, or completion. If it's based on completion, that It might be as easy as not catching or re-throwing an error so the job fails instead of completes. This is important not just for no internet, but if there were any other sort of issue, even temporarily, during the operation.

Long term, Backups should be done using WorkManager. If not it's issue #3147. Then, a WorkManager Constraint requiring network access should be added to the backup task. That will mean the backups won't even try to run when there is no network, and should automatically start when the network becomes available.

The code willing still need to check for success, but that should at least mean that loosing service during backup hours won't mean the phone is never backed up.

https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work#constraints

ezaquarii added a commit that referenced this issue Jan 5, 2022
Apply network constrains to prevent daily backup
job being started without network.

Backup job restart is required to apply new constraints.

Similar migration has been applied in the past, but migration
manager does not support re-applying steps again.

Migrations manager has been refactored to make migration
step re-applying easier, as more job restarts can be
required in the future.

Fixes #9632

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
ezaquarii added a commit that referenced this issue Jan 5, 2022
Apply network constrains to prevent daily backup
job being started without network.

Backup job restart is required to apply new constraints.

Similar migration has been applied in the past, but migration
manager does not support re-applying steps again.

Migrations manager has been refactored to make migration
step re-applying easier, as more job restarts can be
required in the future.

Fixes #9632

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
ezaquarii added a commit that referenced this issue Jan 5, 2022
Apply network constrains to prevent daily backup
job being started without network.

Backup job restart is required to apply new constraints.

Similar migration has been applied in the past, but migration
manager does not support re-applying steps again.

Migrations manager has been refactored to make migration
step re-applying easier, as more job restarts can be
required in the future.

Fixes #9632

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
ezaquarii added a commit that referenced this issue Jan 5, 2022
Apply network constrains to prevent daily backup
job being started without network.

Backup job restart is required to apply new constraints.

Similar migration has been applied in the past, but migration
manager does not support re-applying steps again.

Migrations manager has been refactored to make migration
step re-applying easier, as more job restarts can be
required in the future.

Fixes #9632

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
@ezaquarii ezaquarii self-assigned this Jan 5, 2022
ezaquarii added a commit that referenced this issue Jan 5, 2022
Apply network constrains to prevent daily backup
job being started without network.

Backup job restart is required to apply new constraints.

Similar migration has been applied in the past, but migration
manager does not support re-applying steps again.

Migrations manager has been refactored to make migration
step re-applying easier, as more job restarts can be
required in the future.

Fixes #9632

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
ezaquarii added a commit that referenced this issue Jan 5, 2022
Apply network constrains to prevent daily backup
job being started without network.

Backup job restart is required to apply new constraints.

Similar migration has been applied in the past, but migration
manager does not support re-applying steps again.

Migrations manager has been refactored to make migration
step re-applying easier, as more job restarts can be
required in the future.

Fixes #9632

Signed-off-by: Chris Narkiewicz <hello@ezaquarii.com>
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.19.0 milestone Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants