Skip to content

Preserve source file modification time on upload#325

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feat/put-preserve-mtime
Jul 3, 2026
Merged

Preserve source file modification time on upload#325
AndreyVMarkelov merged 1 commit into
masterfrom
feat/put-preserve-mtime

Conversation

@AndreyVMarkelov

Copy link
Copy Markdown
Contributor

Summary

  • Use the source file's mtime as ClientModified instead of time.Now()
  • Dropbox now records the original file timestamp rather than upload time
  • For stdin uploads, the spool file mtime (approximately now) is used
  • Extracts dropboxClientModified() helper for UTC second-precision conversion

Test plan

  • go build ./... passes
  • golangci-lint, staticcheck, govulncheck all pass
  • go test -count=1 -race ./... passes
  • New tests: TestPutFileUsesSourceModifiedTime, TestDropboxClientModifiedUsesUTCSecondPrecision, TestPutStdinSetsClientModified

Use the source file's mtime as ClientModified instead of time.Now(),
so Dropbox records the original timestamp. For stdin uploads the spool
file mtime (approximately now) is used.
@AndreyVMarkelov AndreyVMarkelov merged commit cf235c5 into master Jul 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant