Skip to content
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

Modification date is not preserved when uploading to Dropbox #15381

Closed
stszap opened this issue Nov 21, 2023 · 3 comments · Fixed by #15387
Closed

Modification date is not preserved when uploading to Dropbox #15381

stszap opened this issue Nov 21, 2023 · 3 comments · Fixed by #15387
Assignees
Labels
dropbox Dropbox Protocol Implementation
Milestone

Comments

@stszap
Copy link

stszap commented Nov 21, 2023

Describe the bug
When I try to upload to Dropbox via cyberduck the modification date is always set to the current time. When using the native Dropbox client for upload or cyberduck for download the date is preserved. "Preserve modification date" option is enabled. I also tried to restart cyberduck a few times - no luck.

To Reproduce
Steps to reproduce the behavior:

  1. Create a connection to Dropbox
  2. Upload a file
  3. The modification time is set to current time

Expected behavior
The modification time in Dropbox is the same as the local file.

Screenshots
cyberduck_db_date
(cropped to hide Dropbox email)

Desktop (please complete the following information):

  • OS: maOS
  • Version: 12.7.1
  • cyberduck version: 8.7.1

Log Files
I'm reluctant to post the whole log file in the open but this looks like a relevant part I believe (this log is unrelated to the screenshot above):

2023-11-21 23:57:27,724 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request POST /2/files/upload_session/finish HTTP/1.1
2023-11-21 23:57:27,724 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - POST /2/files/upload_session/finish HTTP/1.1
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Dropbox-API-Path-Root: {".tag":"root","root":"5310331120"}
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Content-Type: application/octet-stream
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - User-Agent: Cyberduck/8.7.1.40770 (Mac OS X/12.7.1) (x86_64) OfficialDropboxJavaSDKv2/5.4.4
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Dropbox-API-Arg: {"cursor":{"session_id":"pid_upload_session:ABIHFfw6ltP80o58OQenBpGjr8VbENxQ2mPLsk6bK7J0NS3r6A","offset":1164087},"commit":{"path":"/ks__6815.pdf","mode":"overwrite","autorename":false,"mute":false,"strict_conflict":false}}
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Transfer-Encoding: chunked
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Host: content.dropboxapi.com
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Connection: Keep-Alive
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Accept-Encoding: gzip,deflate
2023-11-21 23:57:27,725 [httpexecutor-https://content.dropboxapi.com/2/files/upload_session/finish-1] INFO  ch.cyberduck.transcript.request - Authorization: ********

You can clearly see that Dropbox-API-Arg header for POST /2/files/upload_session/finish request doesn't have commit.client_modified parameter which is supposed to be used to set a custom modification time as per the documentation.

@dkocher dkocher added the dropbox Dropbox Protocol Implementation label Nov 22, 2023
@dkocher dkocher self-assigned this Nov 22, 2023
@dkocher dkocher added this to the 8.7.2 milestone Nov 22, 2023
dkocher added a commit that referenced this issue Nov 22, 2023
Set timestamp in transfer status depending on support in write feature
@markabur
Copy link

Would this fix also affect Cloudflare R2, or should I open a separate issue?

@stszap
Copy link
Author

stszap commented Dec 16, 2023

Would this fix also affect Cloudflare R2, or should I open a separate issue?

The fix worked with backblaze too (I later discovered that it was also affected). I don't have cloudflare account to test, but you can try snapshot build.

@dkocher
Copy link
Contributor

dkocher commented Dec 17, 2023

Would this fix also affect Cloudflare R2, or should I open a separate issue?

You would need to adapt the CloudFlare R2 1 connection profile adding the custom property to enable setting timestamps in metadata for S3 objects as in the S3 (Timestamps) 2 profile.

        <key>Properties</key>
        <array>
            <string>s3.listing.metadata.enable=true</string>
        </array>

This is not enabled by default because of performance implications with additional requests required to read and write the
modification date in metadata.

Footnotes

  1. https://github.com/iterate-ch/profiles/blob/main/Cloudflare%20R2%20Storage%20(S3).cyberduckprofile

  2. https://github.com/iterate-ch/profiles/blob/main/S3%20(Timestamps).cyberduckprofile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dropbox Dropbox Protocol Implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants