Commit Graph

20037 Commits

Author SHA1 Message Date
Kamil Myśliwiec
a5c981c18b test: fix flaky test 2026-02-16 13:14:39 +01:00
Kamil Myśliwiec
dc33abecc1 style: address lint errors 2026-02-16 12:12:53 +01:00
Kamil Myśliwiec
9170ecb83f fix: update incorrect package import 2026-02-16 12:01:12 +01:00
Kamil Myśliwiec
43041eb779 chore: update deps 2026-02-16 11:57:47 +01:00
Kamil Myśliwiec
a1b4ee9678 chore: resolve conflicts 2026-02-16 11:55:52 +01:00
Kamil Mysliwiec
7ae88edf30 Merge pull request #15413 from y-nk/julien/argument-metadata-generic
feat(common): add generic for argument metadata
2026-02-16 11:14:08 +01:00
Kamil Mysliwiec
ec95499d4c Apply suggestion from @kamilmysliwiec 2026-02-16 11:13:24 +01:00
Kamil Mysliwiec
5a47244b7b Apply suggestion from @kamilmysliwiec 2026-02-16 11:12:49 +01:00
Kamil Mysliwiec
cd3cae26ec Merge pull request #14900 from nestjs/feat/call-hooks-by-hierarchy-level
feat(core): call hooks by components hierarchy level (order)
2026-02-16 11:12:17 +01:00
Kamil Myśliwiec
953569a0af fix: move hierarchy set after comp host resolution 2026-02-16 11:03:41 +01:00
Kamil Mysliwiec
84f92eb085 Merge pull request #16329 from at7211/feat/validation-pipe-error-format
feat(common): add error format option to validation pipe
2026-02-16 10:37:03 +01:00
Kamil Mysliwiec
5996b8c45a Merge pull request #16147 from miso-kyoungminkim/pipe-type-safety
refactor: update pipe `transform` signatures for improved type safety
2026-02-16 10:36:14 +01:00
Kamil Mysliwiec
6a50042f76 Merge pull request #16374 from snowykte0426/feature/websocket-disconnect-reason-v12
feat(websockets): add disconnect reason parameter
2026-02-16 10:35:12 +01:00
Kamil Mysliwiec
68d075cd90 Merge pull request #15787 from CodeVac513/fix/rabbitmq-prefix
refactor(microservices): fix the typo 'RQM_' to 'RMQ_'
2026-02-16 10:33:40 +01:00
Jay-Chou
cbdc24e91f feat(common): add error format option to validation pipe
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
2026-02-16 15:52:38 +08:00
codeVac513
d67a2ee555 refactor(microservices): update test to match rmq constant rename 2026-02-16 12:57:17 +09:00
CodeVac513
cec1113885 refactor(microservices): fix the typo 'RQM_' to 'RMQ_' 2026-02-16 12:36:19 +09:00
Julien Barbay
ba82ce7316 Merge branch 'nestjs:master' into julien/argument-metadata-generic 2026-02-16 09:43:29 +07:00
kyoungminkim
65297f651e refactor: update pipe transform signatures for improved type safety 2026-02-16 09:40:19 +09:00
snowykte0426
7828c68ab3 fix(microservices): Remove unnecessary exception filter priority changes
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>
2026-02-16 05:00:40 +09:00
snowykte0426
722d27ad17 fix(websockets): Correct distinctUntilChanged for disconnect events
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>
2026-02-16 05:00:11 +09:00
snowykte0426
ad5b731cd0 feat(websockets): add disconnect reason parameter
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>
2026-02-16 04:59:58 +09:00
Kamil Myśliwiec
d37c2664b6 test: remove useless test file 2026-02-15 20:30:56 +01:00
Kamil Myśliwiec
9cf8699892 test: update integration tests to use vitest 2026-02-15 20:28:34 +01:00
Kamil Myśliwiec
d617106f5a chore: resolve merge conflicts 2026-02-15 20:25:59 +01:00
Kamil Myśliwiec
65615baafb chore: resolve merge conflicts 2026-02-15 20:23:58 +01:00
Kamil Mysliwiec
e15b3d79ca Merge pull request #16156 from manureja64/feat/express-graceful-shutdown
Feat/express graceful shutdown
2026-02-15 20:12:33 +01:00
Kamil Mysliwiec
254e5fe409 Merge pull request #15525 from lhj0621/feat/add-error-code
feat(common): allow passing errorCode in HttpExceptionOptions
2026-02-15 20:11:18 +01:00
Himanshu Gupta
d4e7540822 fix(testing): use vitest assertions in shutdown tests 2026-02-16 00:03:12 +05:30
Himanshu Gupta
decb89bf02 refactor(common,express): rename graceful shutdown option
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.
2026-02-15 23:27:34 +05:30
Himanshu Gupta
26953bab74 fix(common,core,express): activate shutdown flag before hooks
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.
2026-02-15 23:27:34 +05:30
Himanshu Gupta
f7e0495e49 fix(testing): increase timeouts for graceful shutdown tests 2026-02-15 23:27:34 +05:30
Himanshu Gupta
ea352f63eb chore(express): Remove debug logs from express adapter
Remove leftover debug logging statements to reduce console noise in the adapter.
2026-02-15 23:27:34 +05:30
Himanshu Gupta
a696ed4585 fix(testing): expose graceful-shutdown e2e specs
Override root tsconfig.json exclusion so TypeScript project service finds
e2e specs. Also set target, strict, and
esModuleInterop compiler options.
2026-02-15 23:27:34 +05:30
Himanshu Gupta
319437ac3f feat(common,express): add graceful shutdown option
Closes #11416
2026-02-15 23:27:34 +05:30
lhj0621
1ab6f0314b Merge branch 'v12.0.0' into feat/add-error-code 2026-02-16 02:25:10 +09:00
Kamil Myśliwiec
e8768e77dc sample: add zod validation, valibot serialization samples 2026-02-15 17:24:55 +01:00
Kamil Mysliwiec
01c5a95b7f Merge pull request #16369 from nestjs/build/esm-migration
build: migrate from cjs to esm
2026-02-15 16:52:54 +01:00
Kamil Myśliwiec
43c0eb67c1 test: fix outdated test 2026-02-15 16:52:29 +01:00
Kamil Myśliwiec
70323a132a chore: resolve merge conflicts 2026-02-15 16:45:03 +01:00
Kamil Mysliwiec
945ca4850d Merge pull request #16370 from nestjs/test/vitest-migration
refactor: migrate from mocha, chai, sinon to vitest
2026-02-15 16:43:08 +01:00
Kamil Mysliwiec
34f18293b9 Merge pull request #16371 from nestjs/sample/esm-migration
sample: migrate all samples to esm and vitest
2026-02-15 16:42:55 +01:00
Kamil Mysliwiec
b28012ebf9 Merge pull request #16372 from nestjs/refactor/minor-tweaks
refactor: minor codebase tweaks
2026-02-15 16:42:44 +01:00
Kamil Mysliwiec
a21fd1d83a Merge pull request #16373 from nestjs/feat/param-decorator-options
feat: standard schema validation pipe, and standard serializer, introduce internal export subpath
2026-02-15 16:42:30 +01:00
Kamil Myśliwiec
90a40d540e sample: turn off running sample tests for now 2026-02-15 16:03:05 +01:00
Kamil Myśliwiec
d2fd2e692e sample: fix file upload ts compilation error 2026-02-15 15:02:10 +01:00
Kamil Myśliwiec
b6cecd81c4 ci: ignore coverage script errors in ci 2026-02-15 14:30:14 +01:00
Kamil Myśliwiec
9d4c8656cd chore: exclude samples that use cli plugins for now 2026-02-15 14:29:12 +01:00
Kamil Myśliwiec
fb3ae67e25 chore: address lint errors, and fix ci test errors 2026-02-15 14:17:05 +01:00
Kamil Myśliwiec
543142d5ce fix: dont export plain literal object interface 2026-02-15 13:31:12 +01:00