immich
immich copied to clipboard
[BUG] Mobile app: Backup settings page takes a long time to load state
When the mobile app's backup_controller_page is initializing, one of the steps in getting its state involves loading the list of local albums that are present on the device. This is implemented in _getBackupAlbumsInfo() simply by looping through all the albums on the device.
This process happens synchronously when instantiating the backup settings view. Something about it is very slow, and as it blocks the loading of the state, it takes quite a while for the view to be loaded properly (displaying incorrect settings, counts, etc until then).
The exact reason for the slowness is unclear. It could be in our code, but the photo_manager library we use is also suspicious. As one example, the PhotoManager.getAssetPathList() function loops through all the assets in order to get a total asset count. To determine the exact cause of the slowness, actual profiling would be desired.
Regardless of the reason this album loading process is slow though, there are some steps we can take to mitigate it. This would include for example caching the local albums data and/or loading it asynchronously separate from the other backup state. People who are more familiar than me with the mobile app code might have other ideas as well.
All of the above is based on Android. I do not know whether the iOS app has this issue as well.
I am experiencing the very same issue on iOS. As soon as I go to the page to select the albums for backup, the loading indicator is displayed and the page never finishes loading. My photo Library contains ~340GB of data in ~50 Albums.
I've tried to keep the page open (and prevented the phone from sleeping) for more than 15 minutes. Even this long time wasn't enough to finish loading.
@gorootde Do you have those photos on iCloud with the Optimized Storage setting enabled?
Yes I do.
@gorootde So that means the photos are not on the device. That is why the scan result doesn't show any. The app currently works with photos and videos physically on the device.
Thanks for pointing that out. I assumed because of this comment that it works (but is slow). However, not even the photos which are physically on my device (e.g. a photo taken a few seconds ago) show up. I assume this is the expected behaviour until #477 is fixed
Thanks for pointing that out. I assumed because of this comment that it works (but is slow). However, not even the photos which are physically on my device (e.g. a photo taken a few seconds ago) show up. I assume this is the expected behaviour until #477 is fixed
@gorootde I thought so too but apparently not.
I experienced this, and if I type in the search bar and then clear the query then all the results show.
I believe this is solved now thanks to #3905.