-
Notifications
You must be signed in to change notification settings - Fork 395
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
fix: Improved AWS Lambda event detection #2498
Conversation
) { | ||
result = true | ||
} | ||
const v1Keys = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find any information on what AWS does when some field from this list is not included in the payload. Does it send with field: null
? Or does it completely omit the field. We are assuming that it sends field: null
with this implementation, because the v1 example shows some such fields.
|
||
// Event used when one Lambda directly invokes another Lambda. | ||
// https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations | ||
const lambaV1InvocationEvent = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not completely convinced this is the only payload shape that Lambda sends with direct invocations. But I can't find any other documentation to prove that.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2498 +/- ##
==========================================
+ Coverage 96.20% 97.14% +0.94%
==========================================
Files 288 288
Lines 45305 45314 +9
==========================================
+ Hits 43586 44022 +436
+ Misses 1719 1292 -427
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
e51a647
to
7409291
Compare
Opening this up for review, but I would feel better about this if we had a localstack based canary test. |
Well, I started an experiment to build out such a canary, but it won't work for us: https://docs.localstack.cloud/user-guide/aws/lambda/
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we certain all those fields from developer guide are you required? we went from a very naive check to a very rigid one.
No. It's not clear. But what I'm getting from the docs is that the top-level object will always have those keys. |
This PR resolves #2489.