Add a new `errorFormat` option to `ValidationPipeOptions` that allows
users to choose between two validation error formats:
- 'list' (default): Returns an array of error message strings with
parent path prepended to messages (current behavior)
- 'grouped': Returns an object with property paths as keys and arrays
of unmodified constraint messages as values
The 'grouped' format separates property paths from error messages,
which prevents custom validation messages from being modified with
parent path prefixes.
Closes#16268
Remove the changes to exception filter handling in RPC exceptions handler
as the current behavior is the intended behavior according to maintainer
feedback.
Signed-off-by: snowykte0426 <snowykte0426@naver.com>
Fix the distinctUntilChanged operator in subscribeDisconnectEvent to properly
compare client objects when using the new { client, reason } format. The
previous implementation would not deduplicate correctly as it compared object
references instead of the actual client instances.
This ensures backward compatibility while properly handling both the old
format (just client) and new format ({ client, reason }) for disconnect events.
Signed-off-by: snowykte0426 <snowykte0426@naver.com>
This change enhances the WebSocket disconnect handling by providing
the disconnect reason as an optional second parameter to the
handleDisconnect method.
Changes:
- Add optional reason parameter to OnGatewayDisconnect interface
- Update NestGateway interface to support disconnect reason
- Modify WebSocketsController to capture and forward disconnect reason
- Enhance IoAdapter to extract reason from Socket.IO disconnect events
- Maintain full backward compatibility with existing implementations
- Add comprehensive unit and integration tests
The disconnect reason helps developers understand why clients disconnect,
enabling better error handling and debugging. Common reasons include
'client namespace disconnect', 'transport close', 'ping timeout', etc.
This change is fully backward compatible - existing code continues to
work without modification while new code can optionally access the
disconnect reason.
Closes#15437
Signed-off-by: snowykte0426 <snowykte0426@naver.com>
Rename gracefulShutdown to return503OnClosing to align the HTTP
option name with Fastify's terminology. The previous name was too
vague and could imply broader behavior (connection draining, grace
periods) beyond what it actually does.
Move isShuttingDown flag activation from dispose() to a new
prepareClose() step that runs before callDestroyHook(). This prevents
new requests from being processed while providers are being destroyed
during shutdown.
Add beforeClose() to HttpServer interface and AbstractHttpAdapter so
adapters can be notified before the shutdown lifecycle begins.