-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Preserve Last Modification Date #528
Preserve Last Modification Date #528
Conversation
The UriBasedDataSource via the ContentResolverUtil can obtain the original last modification date of the source. This info can pass through all architecture to the data layer and used by the various APIs.
No need of modified list because the last modified date was already fetched (not tested)
Onedrive provide a "fileSystemInfo resource type" [1] that contains properties that are reported by the device's local file system for the local version of an item. To fetch the original last modified date we have to pass an additional argument which will be stored server side and retrieved in a second moment. In the uploadFile() method a new PATCH request have been added to update those info. In the chunkedUploadFile() is sufficient add a property to the request. When a CloudNode is created by the OnedriveCloudNodeFactory the fileSystemInfo are used. [1] https://learn.microsoft.com/en-us/graph/api/resources/filesysteminfo?view=graph-rest-1.0#notes
…ustFanta01/cryptomator-android into feature/preserve-mod-date-main
WalkthroughThis update enhances file metadata handling across various cloud storage integrations in Cryptomator. It introduces mechanisms to preserve and accurately reflect the last modified dates of files, ensuring consistency and reliability in metadata management across different platforms and local encryption scenarios. Changes
Possibly related issues
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
data/src/main/java/org/cryptomator/data/cloud/crypto/CryptoImplDecorator.kt
Show resolved
Hide resolved
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveImpl.kt
Outdated
Show resolved
Hide resolved
data/src/main/java/org/cryptomator/data/cloud/webdav/network/ConnectionHandlerHandlerImpl.kt
Outdated
Show resolved
Hide resolved
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveCloudNodeFactory.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your input 💚, we are almost there!
Please have a look at my suggestions, also here are some more general notes
- In Kotlin, you do not need a semicolon at the end of a statement
- Use automatic formatting, some if statements are not formatted correctly, for example
- We still need to improve our gitignore, I know, but please don't commit the changes in the .idea files
- What about other WebDAV servers, have you found any headers we can set in addition to Nextcloud's?
I will test your changes and get back to you.
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveImpl.kt
Outdated
Show resolved
Hide resolved
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveImpl.kt
Outdated
Show resolved
Hide resolved
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveImpl.kt
Outdated
Show resolved
Hide resolved
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveImpl.kt
Outdated
Show resolved
Hide resolved
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveImpl.kt
Outdated
Show resolved
Hide resolved
data/src/main/java/org/cryptomator/data/cloud/webdav/network/WebDavClient.kt
Outdated
Show resolved
Hide resolved
domain/src/main/java/org/cryptomator/domain/usecases/cloud/DataSource.kt
Show resolved
Hide resolved
domain/src/main/java/org/cryptomator/domain/usecases/cloud/FileBasedDataSource.kt
Outdated
Show resolved
Hide resolved
presentation/src/main/java/org/cryptomator/presentation/util/ContentResolverUtil.kt
Show resolved
Hide resolved
presentation/src/main/java/org/cryptomator/presentation/util/ContentResolverUtil.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveImpl.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are on the right track 👍
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveCloudNodeFactory.kt
Outdated
Show resolved
Hide resolved
Have you found any other headers related to other WebDAV implementations that we can set to adjust the modification date on other servers as well? |
Nope, we tried looking for other WebDav implementations but the documentations are pretty poor in terms of modification date headers, so we preferred to keep our focus on thumbnails implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
data/src/apiKey/java/org/cryptomator/data/cloud/onedrive/OnedriveCloudNodeFactory.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thank you very much for your contribution!
Hello guys 👋
This is our attempt to preserve the last modified date for various clouds [/issues/239]
Me, @WheelyMcBones and @taglioIsCoding have made changes for:
At the moment we haven't implemented for:
Finally we have run all the tests successfully!
Summary by CodeRabbit