-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File timestamps are not preserved on upload anymore #10900
Comments
I concuer, I want to bump this too. It just caused me hedache with around 500 images now all over the timeline. |
I cannot seem to reproduce this; the files I upload retain their creation timestamp as reported by the server. Can you tell me exact steps (as in, how are you checking the timestamp, etc)? |
I have set up the Nc client on my phone to auto upload, the photos taken with the phone, but only when the device is on Wifi. So in the evening, when I got back home, it started upload the photos. Now my photos are all over the place in terms of time, if I check them on Nextcloud webgui, there is no order to the photos. ie, pictures taken in the dark is behind pictures when the sun was still up, so it indivisble, that the timestamps got confused. So maybe this strange behaviour causing the time stamp issue(?) Also I just wan't to flag it here as well since you closed my other topic, that the new version of nextcloud app, drains an ungodly amount of my battery. This wasn't the case with older version of the app. |
Hi @AlvaroBrey, sure, but I'm afraid there are no special steps involved. My NC webinterface, and also the files downloaded through NC desktop client simply carry the upload timestamp now instead of the real creation timestamp.. So, for a visual example: Yesterday I took a bunch of photos outside, say between 14:00 und 17:00. Those were not uploaded immediately as "WiFi only" is checked. When I got home at 18:23 and my phone connected to my WiFi, all the pics were uploaded through regular auto-upload, nothing special. Up to version 3.22.1, each file would have the original creation timestamp (anything between 14-17h) and this would show correctly in NC webinterface and also when downloading the files onto a computer. And now.. all files pretend to be created at 18:23, as shown in webinterface as well as after downloading. |
Ok, so both of you are using autoupload and uploading later when connected to wifi, that gives me some clues. Can you check if a manually uploaded file preserves timestamp correctly? |
Negative, manual uploads carry upload timestamp as well. Inspecting on the server directly.. original timestamp of the file (on my phone) is as indicated in its filename (Jul 2020). Manual upload was (today) 18:38.
|
Dang, that makes it harder for me, as I was testing manual uploads and they were preserving the correct timestamps. Will have to dig further. |
Does the nextcloud app have the All Files permission, or does it have the media read-only one? |
@AlvaroBrey i can also confirm this. Auto upload or no auto upload same issue. When i click in update files and i select a few photos that i took yesterday once the files upload to the server the photos say modified today at the time I uploaded the files but they should not say that it should keep the date and time when the file was taken on the phone etc. I tired the same steps via iOS nextcloud app and it kept the time and data Test Senario
I also noticed that the app keeps looping on the files. the file are already uploaded and it keeps wanting to sync them again. I can send you a video if you ping me on cloud nextcloud com chat |
It has All Files permission. |
It has all the permissions it can get. |
btw @ people suffering from this, here's a quirky little bash snippet to fix the timestamps according to the filenames.
|
This bug is caused by the new (wrong) logic of upload action, i.e., make a copy of the local file and then upload the copy whose lastModificationTimestamp is of the time-of-copying. BTW, the OC_X_OC_MTIME_HEADER of upload file in library/src/main/java/com/owncloud/android/lib/resources/files/ChunkedFileUploadRemoteOperation.java:
is different from in its super class library/src/main/java/com/owncloud/android/lib/resources/files/UploadFileRemoteOperation.java.
so this bug only appears on files uploaded by ChunkedFileUploadRemoteOperation, i.e., file size larger than the CHUNK_SIZE_WIFI (10240000 bytes) or CHUNK_SIZE_MOBILE (1024000 bytes). |
Same
|
Thanks for the research @hbfrank ! That timestamp is indeed incorrect. However, I still can't reproduce this even with chunked files; I guess it's a matter of whether the specific device changes the modification date when copying the file or not. In #11007, there should soon be a QA APK with this patched. Can any of the affected users use it to verify it's fixed? thanks! |
Ping for affected users, especially @danielb42. APK is here: #11007 (comment) Since I can't reproduce it, and the bug in the code was found and patched, if I don't see any reports of the contrary I'll consider this fixed when that PR is merged. |
@AlvaroBrey Just tested the APK and it looks good to me. If you use Signal on your phone setup backups to a nextlcoud folder and i think you'll be able to reproduce it. Every time my Signal app dose a backup i get the error logs i changed to folder dir to point to the QA app and did a backup no errors under server logs |
@AlvaroBrey looks good!
Everything (timestamp-wise) as it should be. |
Steps to reproduce
Expected behaviour
Timestamps of a file (i.e. creation date/time) should be preserved when uploading.
Actual behaviour
Since the recent update, files uploaded to the server have the upload time set as creation timestamp, erasing the original creation metadata. This is bad, and only one of the more innocuous consequences is having "sort by newest" display files uploaded at the same time in a shuffled way..
Android version
12
Device brand and model
Galaxy A41
Stock or custom OS?
Stock
Nextcloud android app version
3.22.1
Nextcloud server version
24.0.6
Using a reverse proxy?
Yes
Android logs
No response
Server error logs
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: