under-pressure icon indicating copy to clipboard operation
under-pressure copied to clipboard

Annoying deprecation warning in the npm version

Open pasha-vuiko opened this issue 2 months ago • 4 comments

Hello!

I'm using the last currently published version (8.5.0) of the package to NPM and I receive the annoying warning on the first request to the app:

(node:82372) [FSTDEP012] DeprecationWarning: request.context property access is deprecated. Please use "request.routeOptions.config" or "request.routeOptions.schema" instead for accessing Route settings. The "request.context" will be removed in `fastify@5`.
 (Use `node --trace-deprecation ...` to show where the warning was created)

That's because the onRequest() function in index.js uses req.context.config

 function onRequest (req, reply, next) {
     const _pressureHandler = req.context.config.pressureHandler || pressureHandler
     ...
 }

But what I see in the master branch of the repository is that the issue is already fixed:

 function onRequest (req, reply, next) {
     const _pressureHandler = req.routeOptions.config.pressureHandler || pressureHandler
     ...
 }

Could you please tell me when the next release to NPM is planned?

pasha-vuiko avatar Jul 03 '24 17:07 pasha-vuiko