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
docs(client-aborted): remove deprecated function #4898
Conversation
[request.aborted](https://nodejs.org/docs/latest-v16.x/api/http.html#requestaborted) has been deprecated since node 16. It seems like [request.destroyed](https://nodejs.org/docs/latest-v16.x/api/http.html#requestdestroyed) should be used instead
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.
@metcoder95 that makes sense. Thank you for the recommendation! I'll update the page accordingly tomorrow. |
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 , this is ok
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.
@metcoder95 that makes sense. Thank you for the recommendation!
Thanks for the understanding, but as highlighted by @mcollina, this looks good as is 🙂
@@ -55,7 +55,7 @@ const app = Fastify({ | |||
|
|||
app.addHook('onRequest', async (request, reply) => { | |||
request.raw.on('close', () => { | |||
if (request.raw.aborted) { | |||
if (request.raw.destroyed) { |
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 bit late for the comment, but destroyed
is not identical to aborted
.
destoryed
should always true
when calling request.destroy()
. However, it doesn't indicate the request
is aborted
(meaning readableEnded
is not true
or complete
is not true
.)
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.
It seems is deprecated but still we use it for the onRequestAbort
hook (ref)
Maybe we should change the docs to onRequestAbort
as best-effort?
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.
It seems is deprecated but still we use it for the onRequestAbort hook
Yes, it is deprecated and we are still using.
But I assume it would never been able to remove.
Maybe we should change the docs to onRequestAbort as best-effort?
The guide is explaining request abort in detail. I would keep it since the function is reference this document for further explanation.
This reverts commit cc347d7.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastify](https://www.fastify.io/) ([source](https://togithub.com/fastify/fastify)) | [`4.19.2` -> `4.20.0`](https://renovatebot.com/diffs/npm/fastify/4.19.2/4.20.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/fastify/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/fastify/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/fastify/4.19.2/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/fastify/4.19.2/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>fastify/fastify (fastify)</summary> ### [`v4.20.0`](https://togithub.com/fastify/fastify/releases/tag/v4.20.0) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.2...v4.20.0) #### What's Changed - build(deps-dev): Bump [@​sinclair/typebox](https://togithub.com/sinclair/typebox) from 0.28.20 to 0.29.1 by [@​dependabot](https://togithub.com/dependabot) in [fastify/fastify#4877 - Update Prototype-Poisoning.md by [@​ed-henrique](https://togithub.com/ed-henrique) in [fastify/fastify#4879 - docs: adjust line for linter by [@​metcoder95](https://togithub.com/metcoder95) in [fastify/fastify#4882 - Fixed type inference on .code().send() by [@​aadito123](https://togithub.com/aadito123) in [fastify/fastify#4880 - chore: refactor Error-typings and tests by [@​svrnwnsch](https://togithub.com/svrnwnsch) in [fastify/fastify#4824 - test: add missing assertion for a test by [@​kibertoad](https://togithub.com/kibertoad) in [fastify/fastify#4701 - chore: tests for genReqIdFactory and minor changes by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4783 - Added type definition for allowUnsafeRegex by [@​xijdk](https://togithub.com/xijdk) in [fastify/fastify#4792 - docs(security): update policy on ci/cd reports by [@​jsumners](https://togithub.com/jsumners) in [fastify/fastify#4890 - improve hooks.validate by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4804 - ci: enable caching; split jobs by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4889 - docs(plugins): note side-effect when using `await` in `fastify.register()` by [@​hateablestream](https://togithub.com/hateablestream) in [fastify/fastify#4846 - \[hooks] Refine hook runners by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4805 - docs: fix wrong header size for FST_ERR_ASYNC_CONSTRAINT in Errors.md by [@​graphiteisaac](https://togithub.com/graphiteisaac) in [fastify/fastify#4893 - fix: rework FastifyErrors, ensure documentation completeness by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4892 - feat: add childLoggerFactory config by [@​brettwillis](https://togithub.com/brettwillis) in [fastify/fastify#4760 - Fix setNotFoundHandler handler type by [@​Ethan-Arrowood](https://togithub.com/Ethan-Arrowood) in [fastify/fastify#4897 - restore code coverage by [@​mcollina](https://togithub.com/mcollina) in [fastify/fastify#4841 - fix: handle abort signal before server is ready by [@​shayff](https://togithub.com/shayff) in [fastify/fastify#4886 - docs(client-aborted): remove deprecated function by [@​JekRock](https://togithub.com/JekRock) in [fastify/fastify#4898 - Revert "docs(client-aborted): remove deprecated function ([#​4898](https://togithub.com/fastify/fastify/issues/4898))" by [@​climba03003](https://togithub.com/climba03003) in [fastify/fastify#4901 - docs(logging): fix typo by [@​yamanidev](https://togithub.com/yamanidev) in [fastify/fastify#4905 - Support IPv6 ::1 in listeningOrigin by [@​mcollina](https://togithub.com/mcollina) in [fastify/fastify#4902 - fix: extend isCustomValidatorCompiler from parent controller by [@​tinchoz49](https://togithub.com/tinchoz49) in [fastify/fastify#4903 - fix: allow uppercase requestdHeader by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4906 #### New Contributors - [@​ed-henrique](https://togithub.com/ed-henrique) made their first contribution in [fastify/fastify#4879 - [@​svrnwnsch](https://togithub.com/svrnwnsch) made their first contribution in [fastify/fastify#4824 - [@​xijdk](https://togithub.com/xijdk) made their first contribution in [fastify/fastify#4792 - [@​hateablestream](https://togithub.com/hateablestream) made their first contribution in [fastify/fastify#4846 - [@​graphiteisaac](https://togithub.com/graphiteisaac) made their first contribution in [fastify/fastify#4893 - [@​shayff](https://togithub.com/shayff) made their first contribution in [fastify/fastify#4886 - [@​JekRock](https://togithub.com/JekRock) made their first contribution in [fastify/fastify#4898 - [@​yamanidev](https://togithub.com/yamanidev) made their first contribution in [fastify/fastify#4905 - [@​tinchoz49](https://togithub.com/tinchoz49) made their first contribution in [fastify/fastify#4903 **Full Changelog**: fastify/fastify@v4.19.2...v4.20.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/tomacheese/telcheck). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44LjExIiwidXBkYXRlZEluVmVyIjoiMzYuOC4xMSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastify](https://www.fastify.io/) ([source](https://togithub.com/fastify/fastify)) | [`4.19.2` -> `4.20.0`](https://renovatebot.com/diffs/npm/fastify/4.19.2/4.20.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/fastify/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/fastify/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/fastify/4.19.2/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/fastify/4.19.2/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>fastify/fastify (fastify)</summary> ### [`v4.20.0`](https://togithub.com/fastify/fastify/releases/tag/v4.20.0) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.2...v4.20.0) #### What's Changed - build(deps-dev): Bump [@​sinclair/typebox](https://togithub.com/sinclair/typebox) from 0.28.20 to 0.29.1 by [@​dependabot](https://togithub.com/dependabot) in [fastify/fastify#4877 - Update Prototype-Poisoning.md by [@​ed-henrique](https://togithub.com/ed-henrique) in [fastify/fastify#4879 - docs: adjust line for linter by [@​metcoder95](https://togithub.com/metcoder95) in [fastify/fastify#4882 - Fixed type inference on .code().send() by [@​aadito123](https://togithub.com/aadito123) in [fastify/fastify#4880 - chore: refactor Error-typings and tests by [@​svrnwnsch](https://togithub.com/svrnwnsch) in [fastify/fastify#4824 - test: add missing assertion for a test by [@​kibertoad](https://togithub.com/kibertoad) in [fastify/fastify#4701 - chore: tests for genReqIdFactory and minor changes by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4783 - Added type definition for allowUnsafeRegex by [@​xijdk](https://togithub.com/xijdk) in [fastify/fastify#4792 - docs(security): update policy on ci/cd reports by [@​jsumners](https://togithub.com/jsumners) in [fastify/fastify#4890 - improve hooks.validate by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4804 - ci: enable caching; split jobs by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4889 - docs(plugins): note side-effect when using `await` in `fastify.register()` by [@​hateablestream](https://togithub.com/hateablestream) in [fastify/fastify#4846 - \[hooks] Refine hook runners by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4805 - docs: fix wrong header size for FST_ERR_ASYNC_CONSTRAINT in Errors.md by [@​graphiteisaac](https://togithub.com/graphiteisaac) in [fastify/fastify#4893 - fix: rework FastifyErrors, ensure documentation completeness by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4892 - feat: add childLoggerFactory config by [@​brettwillis](https://togithub.com/brettwillis) in [fastify/fastify#4760 - Fix setNotFoundHandler handler type by [@​Ethan-Arrowood](https://togithub.com/Ethan-Arrowood) in [fastify/fastify#4897 - restore code coverage by [@​mcollina](https://togithub.com/mcollina) in [fastify/fastify#4841 - fix: handle abort signal before server is ready by [@​shayff](https://togithub.com/shayff) in [fastify/fastify#4886 - docs(client-aborted): remove deprecated function by [@​JekRock](https://togithub.com/JekRock) in [fastify/fastify#4898 - Revert "docs(client-aborted): remove deprecated function ([#​4898](https://togithub.com/fastify/fastify/issues/4898))" by [@​climba03003](https://togithub.com/climba03003) in [fastify/fastify#4901 - docs(logging): fix typo by [@​yamanidev](https://togithub.com/yamanidev) in [fastify/fastify#4905 - Support IPv6 ::1 in listeningOrigin by [@​mcollina](https://togithub.com/mcollina) in [fastify/fastify#4902 - fix: extend isCustomValidatorCompiler from parent controller by [@​tinchoz49](https://togithub.com/tinchoz49) in [fastify/fastify#4903 - fix: allow uppercase requestdHeader by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4906 #### New Contributors - [@​ed-henrique](https://togithub.com/ed-henrique) made their first contribution in [fastify/fastify#4879 - [@​svrnwnsch](https://togithub.com/svrnwnsch) made their first contribution in [fastify/fastify#4824 - [@​xijdk](https://togithub.com/xijdk) made their first contribution in [fastify/fastify#4792 - [@​hateablestream](https://togithub.com/hateablestream) made their first contribution in [fastify/fastify#4846 - [@​graphiteisaac](https://togithub.com/graphiteisaac) made their first contribution in [fastify/fastify#4893 - [@​shayff](https://togithub.com/shayff) made their first contribution in [fastify/fastify#4886 - [@​JekRock](https://togithub.com/JekRock) made their first contribution in [fastify/fastify#4898 - [@​yamanidev](https://togithub.com/yamanidev) made their first contribution in [fastify/fastify#4905 - [@​tinchoz49](https://togithub.com/tinchoz49) made their first contribution in [fastify/fastify#4903 **Full Changelog**: fastify/fastify@v4.19.2...v4.20.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/redwoodjs/redwood). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44LjExIiwidXBkYXRlZEluVmVyIjoiMzYuOC4xMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [fastify](https://www.fastify.io/) ([source](https://togithub.com/fastify/fastify)) | [`4.19.2` -> `4.20.0`](https://renovatebot.com/diffs/npm/fastify/4.19.2/4.20.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/fastify/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/fastify/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/fastify/4.19.2/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/fastify/4.19.2/4.20.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>fastify/fastify (fastify)</summary> ### [`v4.20.0`](https://togithub.com/fastify/fastify/releases/tag/v4.20.0) [Compare Source](https://togithub.com/fastify/fastify/compare/v4.19.2...v4.20.0) #### What's Changed - build(deps-dev): Bump [@​sinclair/typebox](https://togithub.com/sinclair/typebox) from 0.28.20 to 0.29.1 by [@​dependabot](https://togithub.com/dependabot) in [fastify/fastify#4877 - Update Prototype-Poisoning.md by [@​ed-henrique](https://togithub.com/ed-henrique) in [fastify/fastify#4879 - docs: adjust line for linter by [@​metcoder95](https://togithub.com/metcoder95) in [fastify/fastify#4882 - Fixed type inference on .code().send() by [@​aadito123](https://togithub.com/aadito123) in [fastify/fastify#4880 - chore: refactor Error-typings and tests by [@​svrnwnsch](https://togithub.com/svrnwnsch) in [fastify/fastify#4824 - test: add missing assertion for a test by [@​kibertoad](https://togithub.com/kibertoad) in [fastify/fastify#4701 - chore: tests for genReqIdFactory and minor changes by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4783 - Added type definition for allowUnsafeRegex by [@​xijdk](https://togithub.com/xijdk) in [fastify/fastify#4792 - docs(security): update policy on ci/cd reports by [@​jsumners](https://togithub.com/jsumners) in [fastify/fastify#4890 - improve hooks.validate by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4804 - ci: enable caching; split jobs by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4889 - docs(plugins): note side-effect when using `await` in `fastify.register()` by [@​hateablestream](https://togithub.com/hateablestream) in [fastify/fastify#4846 - \[hooks] Refine hook runners by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4805 - docs: fix wrong header size for FST_ERR_ASYNC_CONSTRAINT in Errors.md by [@​graphiteisaac](https://togithub.com/graphiteisaac) in [fastify/fastify#4893 - fix: rework FastifyErrors, ensure documentation completeness by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4892 - feat: add childLoggerFactory config by [@​brettwillis](https://togithub.com/brettwillis) in [fastify/fastify#4760 - Fix setNotFoundHandler handler type by [@​Ethan-Arrowood](https://togithub.com/Ethan-Arrowood) in [fastify/fastify#4897 - restore code coverage by [@​mcollina](https://togithub.com/mcollina) in [fastify/fastify#4841 - fix: handle abort signal before server is ready by [@​shayff](https://togithub.com/shayff) in [fastify/fastify#4886 - docs(client-aborted): remove deprecated function by [@​JekRock](https://togithub.com/JekRock) in [fastify/fastify#4898 - Revert "docs(client-aborted): remove deprecated function ([#​4898](https://togithub.com/fastify/fastify/issues/4898))" by [@​climba03003](https://togithub.com/climba03003) in [fastify/fastify#4901 - docs(logging): fix typo by [@​yamanidev](https://togithub.com/yamanidev) in [fastify/fastify#4905 - Support IPv6 ::1 in listeningOrigin by [@​mcollina](https://togithub.com/mcollina) in [fastify/fastify#4902 - fix: extend isCustomValidatorCompiler from parent controller by [@​tinchoz49](https://togithub.com/tinchoz49) in [fastify/fastify#4903 - fix: allow uppercase requestdHeader by [@​Uzlopak](https://togithub.com/Uzlopak) in [fastify/fastify#4906 #### New Contributors - [@​ed-henrique](https://togithub.com/ed-henrique) made their first contribution in [fastify/fastify#4879 - [@​svrnwnsch](https://togithub.com/svrnwnsch) made their first contribution in [fastify/fastify#4824 - [@​xijdk](https://togithub.com/xijdk) made their first contribution in [fastify/fastify#4792 - [@​hateablestream](https://togithub.com/hateablestream) made their first contribution in [fastify/fastify#4846 - [@​graphiteisaac](https://togithub.com/graphiteisaac) made their first contribution in [fastify/fastify#4893 - [@​shayff](https://togithub.com/shayff) made their first contribution in [fastify/fastify#4886 - [@​JekRock](https://togithub.com/JekRock) made their first contribution in [fastify/fastify#4898 - [@​yamanidev](https://togithub.com/yamanidev) made their first contribution in [fastify/fastify#4905 - [@​tinchoz49](https://togithub.com/tinchoz49) made their first contribution in [fastify/fastify#4903 **Full Changelog**: fastify/fastify@v4.19.2...v4.20.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/redwoodjs/redwood). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44LjExIiwidXBkYXRlZEluVmVyIjoiMzYuOC4xMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
request.aborted has been deprecated since node 16.
It seems like request.destroyed should be used instead
Checklist
npm run test
andnpm run benchmark
and the Code of conduct