Open JL102 opened 1 year ago
I have similar behaviour like @JL102. I have some folders with synchronization turned on. I found today that when i downloaded some images from facebook messenger they were copied and sent to server but source image was not removed from folder. This generated 2 same images in different locations on phone.
For me this looks more like copy + delete than move of a file. And it looks like copy is done properly but delete is failing without any message for user.
I think I have a similar problem as well, though I use the manual upload: I always upload the camera images and there have the option "move to ... folder", the folder being on my sd card while the camera folder being on the main phone. Sometimes it fails to move a file to the sd card. as far as I can see, it was always successfully uploaded, but not moved Trying to upload the file again does not result in any kind of warning or similar, but the file is again not moved from camera to sd card folder.
App version: 3.29.0
android 12
⚠️ Before posting ⚠️
Steps to reproduce
I do not have enough information to demonstrate accurate testing conditions because there is no logging for this. (The logging specifically is what this issue is for.)
I frequently encounter files that I have selected as "Move to app folder" not being deleted after they have been uploaded, which leads to duplicates on my phone.
Expected behaviour
Both times UploadFileOperation calls the
move
command, they're wrapped in a try-catch block.Therefore, all errors inside
move
should be fine to propagate up into those calls, since errors should be logged.Actual behaviour
Inside
move
, there is another try-catch, blocking the error from being propagated and therefore preventing it from being logged.I do not want duplicate files on my phone. If the delete fails after the copy successes, the failed delete should be logged. If the error is not logged, then there's no way for me to assist the developers to identify why the delete operation failed.
Either the try-catch should be removed, or if you still need to call
mFile.setStoragePath("")
in this case, then I'd say justthrow e
after that call, so that the exception is logged, and so that we can figure out why the delete operation is failing.Android version
N/A
Device brand and model
N/A
Stock or custom OS?
Stock
Nextcloud android app version
N/A (source)
Nextcloud server version
N/A
Using a reverse proxy?
No
Android logs
N/A
Server error logs
Additional information
I'm not an Android developer and don't have a development environment set up, so I can't make this code modification myself and submit a PR. This is the best I can do at the moment. If this change is implemented, then I'll be able to analyze the debug logs and we'd be able to figure out why my files are being copied to the app folder but not deleted. When that happens, I can create a new issue for that. This issue is solely for the code change.
I'd like to explain, too, why I don't want duplicate files on my phone. From the perspective of a user (which I am), I have no way of verifying that all of my uploads succeeded when the majority (or sometimes all) of my videos/photos stay in my DCIM/Camera folder. On multiple occasions, I had to manually verify that each and every one of my photos got uploaded successfully before manually deleting them from DCIM. Because from my perspective, if Nextcloud says "I will move this file from the source folder to the Nextcloud folder when it's uploaded", and the file remains in the source folder, then the only logical conclusion is that Nextcloud did not upload the file. However, since the delete operation isn't logged when it fails, I'm currently unable to give you any useful information on fixing it.