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

fix: remove undocumented legacy callbacks #18

Merged
merged 1 commit into from
Sep 17, 2020
Merged

fix: remove undocumented legacy callbacks #18

merged 1 commit into from
Sep 17, 2020

Conversation

DavidJFelix
Copy link
Contributor

context.done is from the pre-node4.10 runtime days of lambda, it was deprecated in favor of callback, which is optionally sidelined in favor of an async/promise-based return. If the function receives no callback and returns a promise or is marked as async, you should simply return/throw in order to actuate the callbacks.

Proof that it's no longer even in the documentation
See the note above the typings

While they do technically work... I think relying on them is a bad idea.

`context.done` is from the pre-node4.10 runtime days of lambda, it was deprecated in favor of callback, which is optionally sidelined in favor of an async/promise-based return. If the function receives no callback and returns a promise or is marked as async, you should simply return/throw in order to actuate the callbacks.
@DavidJFelix
Copy link
Contributor Author

@tcbyrd mind taking a look at this?

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'll trust you on this one :)

@gr2m gr2m merged commit 0e6f825 into probot:master Sep 17, 2020
@github-actions
Copy link

🎉 This PR is included in version 0.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

mattcan pushed a commit to mattcan/serverless-lambda that referenced this pull request Nov 5, 2020
When the `done` function was removed in probot#18, the tests were not updated
mattcan pushed a commit to mattcan/serverless-lambda that referenced this pull request Nov 5, 2020
gr2m pushed a commit that referenced this pull request Nov 5, 2020
* fix: broken tests from #18

When the `done` function was removed in #18, the tests were not updated

* fix: TypeError when converting null or undefined

This will fix #34 by setting a default value on the
`lowerCaseKeys` function. You can get into this state when setting up a
test/demo incorrectly or using a lambda warmer (like serverless-warmup).
I am immediately returning because then a clear error can be shown.


Co-authored-by Mauricio Mercado <[email protected]>
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.

2 participants