fix: align multipart completion checksum errors - #74
Merged
Conversation
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
force-pushed
the
codex/issue-48-baddigest
branch
from
August 27, 2026 01:06
578e146 to
5d15241
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BadDigestfor CompleteMultipartUpload object checksum and explicit checksum-type mismatchesFULL_OBJECTandCOMPOSITEsymmetrically, including the previously accepted composite-to-full directionx-amz-checksum-typeheader as no explicit type assertion instead of silently coercing it toCOMPOSITEInvalidRequestwith the algorithm and actual part number when a composite completion omits a part checksumhash.ChecksumMismatch, PutObject, UploadPart, algorithm-mismatch, and CRC64NVME canonicalization behavior unchangedEvidence and scope
AWS documents
BadDigestfor a completion checksum-type mismatch. The missing-part response is backed by the real S3InvalidRequesttranscript 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 --checkCGO_ENABLED=0 go build ./..., andgo vet ./...go test ./cmd ./internal/hash -count=1cmd: 121.544sinternal/hash: 0.481sclaude-opus-5adversarial acceptance at maximum effort: ACCEPT, high confidence, no blockersgo -overlayprobeFixes #48