Skip to content

fix(s3-deployment): handle empty string in Source.data() #35824

Merged
mergify[bot] merged 3 commits intomainfrom
fix-empty-string-source-data
Oct 23, 2025
Merged

fix(s3-deployment): handle empty string in Source.data() #35824
mergify[bot] merged 3 commits intomainfrom
fix-empty-string-source-data

Conversation

@abidhasan-aws
Copy link
Copy Markdown
Contributor

@abidhasan-aws abidhasan-aws commented Oct 23, 2025

Issue # (if applicable)

Closes #35809.
Original PR: #35818
This PR is been created to fasten release of the fix for the p0

Reason for this change

Source.data() fails with a TypeError when called with an empty string as the data parameter in CDK v2.207.0+. This is a regression from v2.206.0 where empty string deployment worked correctly.

The issue manifests as:

TypeError: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at Object.writeFileSync (node:fs:2434:5)

Description of changes

This change handles the the case from renderData function.

Describe any new or updated permissions being added

Description of how you validated changes

Unit tests have been added to cover this case and integ test has also been updated.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

pahud and others added 2 commits October 22, 2025 11:48
- Add explicit handling for empty string input in renderData
- Prevent potential errors when processing empty string data
- Add regression test for empty string Source.data scenario
- Resolve issue #35809 related to empty string data handling
@aws-cdk-automation aws-cdk-automation requested a review from a team October 23, 2025 10:14
@github-actions github-actions bot added the p2 label Oct 23, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 23, 2025
@github-actions github-actions bot added bug This issue is a bug. p0 and removed p2 labels Oct 23, 2025
@abidhasan-aws abidhasan-aws marked this pull request as ready for review October 23, 2025 10:16
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 23, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 23, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 95c8d73 into main Oct 23, 2025
19 of 20 checks passed
@mergify mergify bot deleted the fix-empty-string-source-data branch October 23, 2025 11:51
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. contribution/core This is a PR that came from AWS. p0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-s3-deployment: Source.data fails for empty content

4 participants