Skip to content

fix: align multipart completion checksum errors - #74

Merged
Vonng merged 1 commit into
mainfrom
codex/issue-48-baddigest
Aug 27, 2026
Merged

fix: align multipart completion checksum errors#74
Vonng merged 1 commit into
mainfrom
codex/issue-48-baddigest

Conversation

@Vonng

@Vonng Vonng commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • return BadDigest for CompleteMultipartUpload object checksum and explicit checksum-type mismatches
  • compare FULL_OBJECT and COMPOSITE symmetrically, including the previously accepted composite-to-full direction
  • treat omission of the optional x-amz-checksum-type header as no explicit type assertion instead of silently coercing it to COMPOSITE
  • return InvalidRequest with the algorithm and actual part number when a composite completion omits a part checksum
  • keep global hash.ChecksumMismatch, PutObject, UploadPart, algorithm-mismatch, and CRC64NVME canonicalization behavior unchanged
  • keep all new error helpers and request-state markers package-private so the exported Go compatibility baseline does not change

Evidence and scope

AWS documents BadDigest for a completion checksum-type mismatch. The missing-part response is backed by the real S3 InvalidRequest transcript in boto/s3transfer#241 and its merged fix in boto/s3transfer#242.

The omitted-type change is a deliberate interoperability relaxation: this optional header is checked only when the client actually sends it. The previous path could reject a valid FULL_OBJECT completion while printing FULL_OBJECT as both the received and expected type.

This intentionally does not implement #50. The current CRC64NVME plus COMPOSITE canonicalization remains pinned until a raw AWS probe establishes whether S3 rejects or canonicalizes that request. The completion-side raw-token residue is recorded in the accompanying design document rather than claimed fixed here.

Validation

  • git diff origin/main...HEAD --check
  • CI-equivalent gofmt, CGO_ENABLED=0 go build ./..., and go vet ./...
  • rebrand/exported-symbol compatibility guard and runtime delivery checks
  • go test ./cmd ./internal/hash -count=1
    • cmd: 121.544s
    • internal/hash: 0.481s
  • Claude Code claude-opus-5 adversarial acceptance at maximum effort: ACCEPT, high confidence, no blockers
    • reproduced the pre-fix composite-as-FULL_OBJECT 200/commit bypass with a go -overlay probe
    • confirmed every new assertion fails against the pre-fix implementation
    • probed all five checksum algorithms and both type directions

Fixes #48

Return AWS-compatible errors for CompleteMultipartUpload checksum failures without changing the global streaming checksum mapping. Compare explicit multipart checksum types symmetrically, distinguish missing composite part checksums, and preserve the CRC64NVME canonicalization pending a direct AWS probe.

Signed-off-by: Feng Ruohang <rh@vonng.com>
@Vonng
Vonng force-pushed the codex/issue-48-baddigest branch from 578e146 to 5d15241 Compare August 27, 2026 01:06
@Vonng
Vonng merged commit 590aeaa into main Aug 27, 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.

CompleteMultipartUpload checksum failures return non-AWS error codes

1 participant