You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.1.0
Plugin version
11.0.01
Node.js version
20
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 20
Description
When throwing an error in the websocket route (in our case this is when an unexpected close happens from the user) the node process seems to exit with status code 1 instead of just abandoning the connection causing the entire app to stop and then leads to unstable restarts when in our case Heroku tries to restart the app.
@AnzeKop its tricky for us as maintainers to debug other folks code like this -- if you can put together a minimal reproduction, we can get to the bottom of exactly what the right behaviour of fastify-websocket should be! I'm not quite sure where in the code above the error you're mentioning is being thrown, and/or if it is being thrown in that async context or in a different one. In general, unhandled exceptions or promise rejections teardown the whole process, and it already looks like you have a try/catch around it there, so my guess is your error is actually coming from some other callback outside of that context.
Prerequisites
Fastify version
5.1.0
Plugin version
11.0.01
Node.js version
20
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Ubuntu 20
Description
When throwing an error in the websocket route (in our case this is when an unexpected close happens from the user) the node process seems to exit with status code 1 instead of just abandoning the connection causing the entire app to stop and then leads to unstable restarts when in our case Heroku tries to restart the app.
Example is this.
Link to code that reproduces the bug
No response
Expected Behavior
Throwing an error inside a socket handler stops any ongoing processes/function executions and just closes the connection.
If there is any better way to stop any ongoing execution I'm happy to hear suggestions
The text was updated successfully, but these errors were encountered: