-
-
Notifications
You must be signed in to change notification settings - Fork 315
Set QuickXorHash as checksum to compare file changes #17311
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
Conversation
We have Hashes for Files available already: quickXorHash is guaranteed to be available. |
Alternatively, use the cTag1-property:
Relying on a implementation detail of the eTag is dangerous. Footnotes |
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.
Pull Request Overview
This PR implements UUID-based checksum comparison for OneDrive/SharePoint by extracting UUIDs from ETag values that remain constant when moving files, enhancing file synchronization accuracy.
- Modifies
Checksum
class to support UUID extraction from ETag values formatted as"{UUID},version"
- Updates OneDrive features to use checksum-based comparison instead of timestamp-only comparison
- Adds comprehensive test coverage for checksum behavior during file operations
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
core/src/main/java/ch/cyberduck/core/io/Checksum.java |
Enhanced checksum parsing to support Base64 and improved hex string handling with proper validation |
onedrive/src/main/java/ch/cyberduck/core/onedrive/features/GraphAttributesFinderFeature.java |
Added checksum extraction from OneDrive file hashes (QuickXorHash) |
onedrive/src/main/java/ch/cyberduck/core/onedrive/GraphProtocol.java |
Updated comparison service to use checksum-based comparison with fallback to timestamp |
onedrive/src/test/java/ch/cyberduck/core/onedrive/*Test.java |
Added comprehensive test assertions for checksum behavior during write and move operations |
Co-authored-by: Copilot <[email protected]>
This reverts commit fea39f3
cddafca
to
46bc3b1
Compare
if(file != null) { | ||
final Hashes hashes = file.getHashes(); | ||
if(hashes != null) { | ||
attributes.setChecksum(Checksum.parse(hashes.getQuickXorHash())); |
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.
This relies on quickXorHash always being 20 Bytes, and is misrepresented as SHA1.
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.
You are right. Full implementation requires us to implement quickXorHash
as a ChecksumCompute
feature.
Extract UUID from ETag formatted as"{D7751A14-FEA5-4BDA-969E-F8022E58B7E7},9"
which remains constant when moving files.