Skip to content

Conversation

dwrth
Copy link
Contributor

@dwrth dwrth commented Aug 6, 2025

Summary

Changes

This PR resolves the code quality issues mentioned in #4248 by implementing base handlers which are then reused for both the synchronous and asynchronous handlers.

With this approach we avoid duplicate code and enforce DRY principles.

Issue number: closes #4248


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

@boring-cyborg boring-cyborg bot added the tests PRs that add or change tests label Aug 6, 2025
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Aug 6, 2025
@dwrth
Copy link
Contributor Author

dwrth commented Aug 6, 2025

I have noticed the handlerWithContext also having the same duplicate logic and refactored it in the same fashion. Let me know if I should revert that commit of if that's alright!

Copy link

sonarqubecloud bot commented Aug 6, 2025

@svozza
Copy link
Contributor

svozza commented Aug 6, 2025

Thanks so much @dwrth, this looks good to go now!

@svozza svozza merged commit 75e233f into aws-powertools:main Aug 6, 2025
34 checks passed
uttam282005 pushed a commit to uttam282005/powertools-lambda-typescript that referenced this pull request Aug 7, 2025
…s#4281)

Co-authored-by: David <75678655+David-Werth@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M PR between 30-99 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: Refactor duplicate test handler functions in batch package
2 participants