Skip to content
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

Don't Call JSON.parse on event.body #89

Merged
merged 1 commit into from
Mar 9, 2022
Merged

Conversation

ajschmidt8
Copy link
Contributor

Fixes #78.

This PR removes the JSON.parse call from event.body. This was causing issues when trying to invoke Lambda functions asynchronously with async set to true in a serverless.yaml config file. I'm not exactly sure why this doesn't cause issues when async is not set to true, but I tested these changes with http events (both async: true and async: false) and httpApi events and it seemed to work fine on both. Also, I believe the verifyAndReceive function internally handles both objects and strings anyway.

Fixes probot#78.

This PR removes the `JSON.parse` call from `event.body`. This was causing issues when trying to invoke Lambda functions asynchronously with `async` set to `true` in a `serverless.yaml` config file. I'm not exactly sure why this doesn't cause issues when `async` is not set to `true`, but I tested these changes with `http` events (both `async: true` and `async: false`) and `httpApi` events and it seemed to work fine on both. Also, I believe the `verifyAndReceive` function internally handles both objects and strings anyway.
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

I trust you and your thorough testing discussed in #78. Thank you!

@gr2m gr2m merged commit c8472ff into probot:master Mar 9, 2022
@github-actions
Copy link

github-actions bot commented Mar 9, 2022

🎉 This PR is included in version 3.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ajschmidt8 ajschmidt8 deleted the fix-async branch March 9, 2022 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to run the lambda asynchronously
2 participants