Skip to content

fix: remove undocumented legacy callbacks#18

Merged
gr2m merged 1 commit intoprobot:masterfrom
DavidJFelix:patch-1
Sep 17, 2020
Merged

fix: remove undocumented legacy callbacks#18
gr2m merged 1 commit intoprobot:masterfrom
DavidJFelix:patch-1

Conversation

@DavidJFelix
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@tcbyrd mind taking a look at this?

Copy link
Copy Markdown
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
Copy Markdown

🎉 This PR is included in version 0.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

mattcan added 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 added 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