Skip to content

Add upper-bound chunk-size validation to put#295

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
put/chunk-size-validation
Jun 26, 2026
Merged

Add upper-bound chunk-size validation to put#295
AndreyVMarkelov merged 1 commit into
masterfrom
put/chunk-size-validation

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rejects --chunksize values below 4MiB or above 128MiB with distinct error messages, in addition to the existing multiple-of-4MiB check.
  • Extracts putChunkSizeUnit and putMaxChunkSize constants to replace inline magic numbers.
  • Updates flag descriptions for --chunksize and --workers to clarify they apply to chunked large-file uploads.
  • Adds a README section explaining upload sessions and when to tune chunk size/workers.
  • Converts the chunk-size test to a table-driven test covering all three validation branches.

Test plan

  • go test ./cmd/ -run TestPutChunkSize passes all three cases
  • go build ./... succeeds
  • go run ./tools/gen-docs output matches docs/commands/dbxcli_put.md
  • CI passes

Reject chunk sizes below 4MiB, not a multiple of 4MiB, or above 128MiB
with distinct error messages. Previously only the modulo check existed,
silently allowing values that exceed Dropbox upload-session limits.
Update flag descriptions, examples, and generated docs to document the
constraints.
@AndreyVMarkelov AndreyVMarkelov merged commit 62706fb into master Jun 26, 2026
8 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