-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
fix(FileCache): mtime when not provided backend at zero #45396
Conversation
07de83b
to
30d712d
Compare
Please elaborate. |
I came accross an external storage backend not able to handle modtime, and always reporting When dumping a file that has a modtime, the modtime is stored in NextCloud, though the backend storage has zero. When creating a file/directory without having a modtime coming along, the modtime is currently set to 0 (so, Jan 1st 1970), instead of having something like "now" used. |
Signed-off-by: Adrien "ze" Urban <[email protected]>
30d712d
to
627528f
Compare
What storage backend / service is that, and how is it connected with Nextcloud? I'm unsure if 0 = now is a sane default. |
We are trying to develop a backend using webdav and storing into IPFS. IPFS is currently not able to store any date. So, we have it as external storage on nextcloud, but without this patch, any files created there gets the date from 1970. Would you have any alternative suggestion? Maybe a way to implement/configure per (external) storage a do-not-trust-dates? |
Because your backend sends 1970 as modified date ;)
If your backend does not provide getlastmodified, why do you send it with 0 as value? Our code should already handle responses without getlastmodified1 properly. Footnotes |
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
Hi @ze42, is this resolved? |
Summary
Some external backend always send 0 as modTime.
Creating a file without explicit timestamp coming from client (as in just creating it now, without having a modTime coming along the data), the file will be created in the backend, and nextcloud will read the modTime from the backend and store it as created in 1970...
More details here
TODO
Checklist