-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(plugins): mixing async and callback style now returns an error #5141
Conversation
lib/pluginUtils.js
Outdated
@@ -134,7 +135,14 @@ function registerPluginName (fn) { | |||
this[kRegisteredPlugins].push(name) | |||
} | |||
|
|||
function checkPluginHealthiness (fn) { |
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.
Let's just check this gets in sync after #5139 gets merged into main
👍
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.
Yep, I'm marking the PR as draft
lib/errors.js
Outdated
@@ -434,6 +434,12 @@ const codes = { | |||
'FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE', | |||
"The decorator '%s'%s is not present in %s" | |||
), | |||
FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER: createError( | |||
'FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER', | |||
'Async function has too many arguments. Async plugin should not use the \'done\' argument.', |
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.
'Async function has too many arguments. Async plugin should not use the \'done\' argument.', | |
'The %s plugin being registered mixes async and callback styles. Async plugin should not mix async and callback style.', |
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.
LGTM 👍
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.
Could you rebase your changes based on the latest next
branch?
398c72a
to
8d6293e
Compare
Done, I also fixed failing tests on the next branch but I'm not sure about the coverage |
Sorry to bother you, I have cleanup the unclean merge from the |
8d6293e
to
fb46dcb
Compare
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.
LGTM, I believe the coverage is not related to this PR.
It is related to the Symbol.asyncDispose
Ok, so I won't fix it in this PR. I thought it was my mistake |
Merging - coverage is a |
Closes #5112, opened as discussed in #5139
Checklist
npm run test
andnpm run benchmark
and the Code of conduct