vauvenal5 / yaga

Nextcloud Yaga - A Nextcloud first gallery app for Android.
https://vauvenal5.github.io/yaga-docs/
GNU General Public License v3.0
136 stars 9 forks source link

Local photos lost before getting auto-uploaded #74

Closed guoweiy closed 3 years ago

guoweiy commented 3 years ago

Local files lost before they are auto-uploaded by the Nextcloud app. It seems that yaga deleted the local files if they do not exist on the server.

Version: 0.21.1

Settings: Home path: nc://xxx@xxx.com/Photos/ Root mapping - remote path: nc://xxx@xxx.com/Photos/ Root mapping - local path: file://device.local/DCIM/Camera/ Nextcloud auto-upload: use the above local and remote paths. Select "original file will be kept in original folder". Also, check "only upload when charging" (so we can control when to start auto-upload).

Steps to reproduce:

  1. Unplug the power cable so that Nextcloud will not auto-upload for now.
  2. Take a photo with the camera. Check the file manager to confirm this photo exists in local DCIM/Camera.
  3. Open Yaga and swipe down to refresh. The new photo appears on the top during the refreshing process and then disappears when refresh finishes. Check the file manager, and the photo can not be found.
vauvenal5 commented 3 years ago

Yes, that is a problem. I will have to change something about the sync strategy. Good that this has come up during the beta stage.

vauvenal5 commented 3 years ago

So, this is fixed in v0.21.2.

I introduced a new option to decide if you want to sync server delete operations into the mapped folder or not. Please not that when this is active then the app will still behave like you described. This is because, currently, the only way of knowing that a file is gone is by making a diff between the local list and the remote list.

Only other option would be get the activity log and scan it for delete activities. However, this would not only be a new feature for the app but also one for the Dart Nextcloud library. To track this I opened #77.