Skip to content

fix(lib-storage): avoid forwarding object-level params to UploadPart - #8042

Closed
danyalahmed1995 wants to merge 1 commit into
aws:mainfrom
danyalahmed1995:fix/lib-storage-uploadpart-param-boundary
Closed

fix(lib-storage): avoid forwarding object-level params to UploadPart#8042
danyalahmed1995 wants to merge 1 commit into
aws:mainfrom
danyalahmed1995:fix/lib-storage-uploadpart-param-boundary

Conversation

@danyalahmed1995

Copy link
Copy Markdown

Issue

Fixes #8020

Description

This narrows the params passed to UploadPartCommand in multipart Upload so object-level Upload params are not forwarded into every part upload.

The multipart path now avoids copying fields such as IfNoneMatch, ContentType, ContentMD5, and concrete user-supplied Checksum* values into UploadPartCommand.

ChecksumAlgorithm is still passed through so the SDK checksum middleware can compute checksums for the actual part body.

This also keeps the single-part PutObjectCommand path unchanged, so object-level params are still preserved when the upload does not use multipart.

Related to #8029. This follows the same UploadPartCommand boundary issue, but also excludes concrete user-supplied Checksum* values from multipart part requests.

Testing

Added regression coverage for:

  • single-part PutObjectCommand preserving object-level params
  • multipart UploadPartCommand not receiving object-level headers/checksum values
  • valid part-level fields still reaching UploadPartCommand
  • CompleteMultipartUploadCommand still receiving IfNoneMatch

Ran:

yarn exec vitest run lib/lib-storage/src/Upload.spec.ts
yarn exec vitest run -c lib/lib-storage/vitest.config.mts lib/lib-storage/src

Also verified locally with a custom request handler using the real S3Client serializer path. Multipart UploadPart requests no longer carried the object-level conditional/checksum headers, while the single PutObject path still preserved them.

Checklist

  • If the PR is a feature, add integration tests (*.integ.spec.ts) or E2E tests.
    • It’s not a feature.
  • My E2E tests are resilient to concurrent I/O.
    • I didn’t write any E2E tests.
  • I added access level annotations e.g. @public, @internal tags and enabled doc generation on the package. Remember that access level annotations go below the description, not above.
    • I didn’t add any public functions.
  • Streams - how do they work?? My WebStream readers/locks are properly lifecycled. Node.js stream backpressure is handled. Error handling.
    • No stream lifecycle changes.

@danyalahmed1995

Copy link
Copy Markdown
Author

@aBurmeseDev If the original issue is resolved should i close this PR or you would like to do it ?

@danyalahmed1995

Copy link
Copy Markdown
Author

Closing as the original issue #8020 was resolved.

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.

Upload misses implementation for a few headers

1 participant