Skip to content

fix(parameters): Correctly check for empty values in AppConfig Parameters Provider. #1982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2025

Conversation

phipag
Copy link
Contributor

@phipag phipag commented Jul 29, 2025

Summary

This PR fixes an issue where the AppConfig Provider wrongly returns null. AppConfig returns an empty byte array on GetLatestConfigurationChange if there was no change since the session was established. It is not sufficient to perform a null check but rather we should check if the byte array is of length zero.

This PR is similar to #1673 against v1 but was not migrated correctly to v2.

Related docs: https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-code-samples-using-API-read-configuration.html

Also resolves existing Sonarcube linting errors where possible.

Changes

Issue number: #1981


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@phipag phipag self-assigned this Jul 29, 2025
@phipag phipag added bug Something isn't working parameters labels Jul 29, 2025
@phipag phipag linked an issue Jul 29, 2025 that may be closed by this pull request
@phipag phipag requested a review from leandrodamascena July 29, 2025 07:49
Copy link

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@phipag phipag merged commit 2bb51d8 into main Jul 29, 2025
13 checks passed
@phipag phipag deleted the 1981-bug-regression-error-in-v2-appconfig-parameters branch July 29, 2025 07:59
@github-project-automation github-project-automation bot moved this from Pending review to Coming soon in Powertools for AWS Lambda (Java) Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parameters size/L
Projects
Status: Coming soon
Development

Successfully merging this pull request may close these issues.

Bug: Regression error in v2 AppConfig parameters
2 participants