Auto-upload. What's going on there?

Because I didn’t understand what was happening during auto upload, I reflashed my POCO F2 with a clean LineageOS 18.1 / Android 11 and GApps first. Then Installed “Total Commander” to have a simple view into the file system.
Then I took 2 pictures with the buildin camera app. One of these pictures I moved from “DCIM/Camera” to “Download”.

On the server side (Manjaro-Linux machine in my LAN) I created a new folder “Upload-Test” in Nextcloud and copied a 2 pictures from anywhere to the folder.

After preparing this, I have installed NextCloud Client 3.18.0 from froid-store, and conneted the client to my server. All fine so far.
All folders are visible. I can download a picture from server to the phone. And I’m able to delete it.
Ok. Only 1 file remains at server side “Upload-Test” after this initial test.

To start “auto-upload” test on the phone I just took a new photo. The Client App opens and asks for configuration. I choosed “upload existing files”, “keep original” and set “remote folder” to my “Upload-Test” folder.
After activating all my files are synced to server as expected. Wow, fine.

Then I copied the saved file from Download to DCIM/Camera. But nothing happend. Hm.
I renamed the file. Nothing.
I copied the file. Nothing.
I changed timestamp with total commander. Nothing.

Then I took a new photo and the new file is transferred instantly to the server.
Finaly I edited the non uploaded file within gallery. The canged file is transferred too.

Next day I took again a copy of the “not transferred” picture, within the DCIM/Camera folder.
Ups. This time the file is transferred. The server says. Changed 15 hours ago …

There are many kinds of creating a new file. I have seen this common used variants in windows…

  • open file, write data, close file
  • open file & close file (creating a 0 byte file), reopen file, write data, close file
  • creating a new file anywhere and rename&move the final file to destination

So I guess, there is a problem in handling with “FileObserver” in combination with cache.
Maybe that Nextcloud client did not handle all file creation/change methods …


@Andy this seems to be a quite detailled posting (except for NC version and such) but maybe you could chime in here and see if you could use this info somehow?

I’m not familiar with NC error handling yet …
What do you need? Feel free to ask (and point me where to find)

Server-System: Linux 5.10.89-1-MANJARO x86_64
Prozessor: Intel(R) Celeron(R) J4105 CPU @ 1.50GHz (4 cores)
RAM:15.29 GB
NC 23.0.0
PHP 8.0.14
PostgreSQL 13.4

1 Like

My guess is it is a “designed behavior”. The upload relies on Android’s media indexing and also “remembers the last time it detected uploads” so if files with older creation/modification dates than the last detection get added they will be ignored/undetected.

Maybe. But who knows?

And if your guess is right, why there is no hint about this “feature”?
The name “auto-upload” is somewhat misleading in this case, since it suggests just “auto upload” and not “auto-upload if the file is newer as”.
Seems that there are many people with upload problems …

And of course, if you are right, I would like to have some more features in client software:

  • show last upload timestamp (not sync timestamp since there is no real sync)
  • button to force a full upload (maybe reset timestamp)
  • checkbox if you would like full upload every time or upload only newly created files

It is an open source project, so as always pull requests / contributions are welcome! :heart:

1 Like