NeoApplications / Neo-Backup

backup manager for android
GNU Affero General Public License v3.0
2.37k stars 120 forks source link

Number of backups can lead to situation where no data will be kept #792

Open bugsyb opened 9 months ago

bugsyb commented 9 months ago

This one falls more under logic change than a bug/crash type of an item though raising it as bug as can lead to serious data loss.

The way the Neo Backup treats backups is separate entries between any type of a data, i.e. one backup can be only app and other can be external data, obb, etc. Running backups separately for each parts creates "backup entries".

Number of backup entries is then taken into account when checking if it didn't pass the set threshold (default 2) and old backups do not need to be removed. If it does, it removes old backups.

This logic, coupled with, i.e. scheduled backups of updated apps can easily lead to removal of app data which will fall outside of the threshold of number of backups to keep.

This shouldn't work that way. Backups should be treated as overall app + data and last backup of all elements should be kept when number of backups gets checked.

Data loss can happen under such scenario:

We ended up with 2 backups as per current logic and no data for the app.

It would be essential to have logic changed and backup count logic for deletion, should take into account total full set of app & data revisions instead of just entries. This should be default logic as more users can run into it.

One can say, that logic has a flaw as scheduled data backup should be more often that the apk backup and this is true, though to avoid backing up apk every day or i.e. external/obb/media data only the essential data backup might be taken with rest not being backed up more often than every week. This again falls into the same issue, that the other backup entries are deleted whilst should be kept (by type or preferred as proposed that number of revisions including all data types backed up are kept).

Thanks!

RobertZenz commented 8 months ago

That should be related to #699.