Skip to content

fix(parser): allow SQS envelopes to handle non-JSON strings #3513

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 10 commits into from
Jan 23, 2025

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Jan 22, 2025

Summary

Changes

Please provide a summary of what's being changed

This PR updates the SqsEnvelope and SnsSqsEnvelope so that they can handle messages other than JSON strings, i.e. plain text strings like "hello world".

The PR is still WIP and I will update the description once it's done.

To complete this PR I also had to refactor the Middy.js middleware unit tests since they were using the SQS envelope I was touching. Because of this I took the opportunity to simplify & standardize them so that they follow the same conventions as the rest of the project.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: fixes #3510


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.

@dreamorosi dreamorosi self-assigned this Jan 22, 2025
@boring-cyborg boring-cyborg bot added parser This item relates to the Parser Utility tests PRs that add or change tests labels Jan 22, 2025
@pull-request-size pull-request-size bot added the size/XXL PRs with 1K+ LOC, largely documentation related label Jan 22, 2025
@github-actions github-actions bot added the bug Something isn't working label Jan 22, 2025
@dreamorosi dreamorosi marked this pull request as ready for review January 23, 2025 10:10
@dreamorosi dreamorosi requested a review from a team January 23, 2025 10:10
@dreamorosi dreamorosi requested a review from a team as a code owner January 23, 2025 10:10
@dreamorosi dreamorosi requested a review from am29d January 23, 2025 10:10
Copy link
Contributor

@am29d am29d left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Just a minor question on reusing createError helper.

@dreamorosi dreamorosi requested a review from am29d January 23, 2025 13:41
@dreamorosi dreamorosi merged commit 89f0006 into main Jan 23, 2025
38 checks passed
@dreamorosi dreamorosi deleted the fix/sqs_envelopes branch January 23, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser This item relates to the Parser Utility size/XXL PRs with 1K+ LOC, largely documentation related tests PRs that add or change tests
Projects
Development

Successfully merging this pull request may close these issues.

Bug: SQS Envelope assumes message body is always a JSON
3 participants