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

Multiple bug fixed when deleting manually backup folder #1040

Merged
merged 11 commits into from
Dec 5, 2023

Conversation

zatteo
Copy link
Contributor

@zatteo zatteo commented Nov 28, 2023

When an user creates a backup, it creates a backup folder like /Photos/Sauvegardé depuis mon mobile, and the flagship app saves a reference to this backup folder.

In this PR, I mainly handle missing cases, especially when the user trash or trash + empty trash the backup folder.

Some refactoring too.

Function in manageBackup should be high level function. Now we have a
autonomous and complete  initializeLocalBackupConfig to start a
backup from the beginning.
getLocalBackupConfig is wrapped in a try / catch block to check efficiently if there is already a local backup config. But we must not add more code in the try block, because in the catch block we reset the local backup config.

Everything that must follow a "backup found" case must be outside the try block.
In this case :
- user backup his phone : folder A
- user trash folder A
- user backup his phone : folder B
- user restore folder A
*backup feature backup to folder B*
- user reinstall app
*backup feature must backup to folder B*

Backup feature will try to find a folder with the same device ID. But folder A and folder B have the same id. Previously, the first folder received by the stack was selected (folder A). But we want to select the most recent one (folder B).
@zatteo zatteo requested a review from Crash-- November 28, 2023 13:28
Error message was missing when partial success. Allow front end to display it.
Some network errors coming from cozy-client were not detected by
backup feature, so we could not display the good error message to the
user. Now we do.
@zatteo zatteo merged commit de65b9a into master Dec 5, 2023
1 check passed
@zatteo zatteo deleted the fix/error-when-deleting-manually-backup-folder branch December 5, 2023 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants