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
'Missing Id' in DynamoDBEvent parsing - eventVersion 1.1 instead of eventVersion1.0? #26
Comments
Hey @mostalive ! Thanks for spotting this. I was able to reproduce on my side. It looks like I'm trying to extract field names with a capital letter instead of all-lowercase ("Price" versus "price"). Running tests now to see if it fixes the issue and will push a change. As for the |
Hey @mostalive ! I've merged the fix into the main branch. Could you tell me if it's working for you? |
Hi @nmoutschen, deployed a fresh stack to FYI I wonder if the integration tests could stretch to EventBridge (just wondering, I'm probably going to take inspiration from the sample code and send a mail with SES instead, don't need more at the moment). |
Thanks a lot! Yep, ideally I'd like to add an integration test to EventBridge, but there are a few things that makes it more complicated. EventBridge doesn't expose a listener API, so I would need to create a test harness, such as an SQS queue listening to events from this sample, and then check if the events are sent in the queue. |
Thank you for putting this project together - I'm learning Rust (I have some background with Haskell and Purescript), and love tests and hexagons. I have no experience with DynamoDBEvents, nor investigating issues with it, so I may be seeing this wrong, any suggestions appreciated.
Steps to reproduce:
Expected result:
Actual result:
From a CloudWatch log:
Possible fix:
Also (or only?) allow lowercased field names (price, name and id), and parse
ApproximateCreationDateTime
as a float instead of an int.I changed
src/entrypoints/lambda/dynamodb/mod.rs
to print the incoming JSON value (I had to change the type to Value, because parsing changes the casing to be snake_case. not complaining, but makes extracting a unit test harder) and then copied that into a test in that mod.rs .The existing unit tests in
src/entrypoints/lambda/dynamodb/model.rs
have "eventVersion": "1.0", the incoming JSON had "eventVersion": "1.1". I have searched, but not been able to find documentation for the various versions.I don't understand why the casing of the filenames changes, as they are part of the dynamodb model. Full messy branch here, this now works for me and sends messages to EventBridge. It is not ready for a pull request, I still don't understand what is going on here. Just curious about your ideas.
The text was updated successfully, but these errors were encountered: