openfoodfacts/openfoodfacts-ios

The offline mode and taxonomies cause a massive iCloud Backup size

Photon-GitHub opened this issue · 2 comments

Summary:
The iCloud backup of any device with OpenFoodFacts will have lots of data only for OpenFoodFacts even on a totally fresh installation, which is indeed larger than the storage the app uses on the device.

Steps to reproduce:

  • Install the app
  • Create backup of the device in iCloud
  • Check the size of the app in the iCloud backup

Expected behavior:

Only save user-relevant data, like the history, in an iCloud backup, therefore only having a footprint of a few megabytes at most in any backup, especially on a totally fresh installation. Especially, I do not expect to have a backup size 5 times larger than the app itself takes up on the device.

Observed behavior:
The iCloud backup of any device with OpenFoodFacts will have anywhere from 150 to over 500(!!!) megabytes of data only for OpenFoodFacts even on a totally fresh installation. Other apps without user data do not cause any extra data in an iCloud backup and it seems to me as if the app backups all downloaded data instead of only data that is user-specific like the history. This causes the app to consistently be in the top-5 of my largest apps in the backup, and people need to manually disable the inclusion in the backup if they do not want the app to use up the (apparently unneeded) backup space. On my iPhone I observed 151.2MB of data, on my iPad even 564MB in the backup, but the local files are only 112.2MB and 116MB (as shown in the local storage overview of the general-settings) respectively. Obviously, a backup is not supposed to be larger than the app itself consistently across devices and even on fresh installations.

Device and iOS version:

Apple iPhone 11 running iOS 14.6
Also tested on
Apple iPad Pro 2018 running iPadOS 14.6

Thank you @Photon-GitHub
This is probably related to:

  1. Offline mode backup
  2. Taxonomy backup

Both are stored in the Open Food Facts database, along with things like scan history and user-settings. I believe we'd have to split the Database in two, to enable selective backup, and reduce the default iCloud backup size.
@aleene @philippeauriach

However 500MB seems a bit large, even for the taxonomies. Wonder if we can exclude these from the backups, as they are easily downloaded.

They can also be reduced further by downloading only the relevant language.