What's changed
@nestjs/common- fix(common): let a null depth print every level in the console logger — backport of #18480
- fix(common): count empty strings toward the json log record cap
- fix(common): check the json log record cap before converting values
- fix(common): limit the error messages of parsed array items in total
- fix(common): rethrow non-validation errors in the parse array pipe
- fix(common): drop the value of validation errors that have children
- fix(common): reject a buffer sent in place of a validated class
- fix(common): reject a buffer held by a nested validated property
- fix(common): validate a stand-in for a buffer sent as the whole value
- fix(common,core): use the default for pipe and sse limits given as nan
- fix(common): validate the files of parse file pipe one at a time
- fix(common): close the gaps of sparse arrays the pipes validate
- fix(common,core): count sse events without data toward the pending limit
- fix(common,core): send the status text in sse errors that wrap an error
- fix(common): keep the scope a class declares when passed to mixin()
@nestjs/core- fix(core): listen for the error of every stream the router holds
- fix(core): share one close listener among the requests of a connection
- fix(core): send what the interceptors return for a streaming handler
- fix(core): catch what the teardown of an sse producer throws
- fix(core): write the waiting events of an sse client in linear time
- fix(core): notice an sse client that left while its socket is paused
- fix(core): keep host params matched next to an optional group
- fix(core): answer http errors that graphql or async rpc filters leave
- fix(core): skip exception filters that were not created for a request
- fix(core): keep a controller root route next to an optional-tail route
- fix(core,fastify): exclude "/x/" only when no other route may serve it
- fix(core,fastify,node): match excluded params up to the router's limit
- fix(core,fastify): end the excluded path at ";" like the fastify router
- fix(core,fastify): match the text after an excluded param as written
- fix(core): run the middleware for a path with a line terminator
- fix(core): mount middleware where the router serves the covered routes
- fix(core): test each versioned path against the prefix exclusions alone
- fix(core): keep the filters of a middleware's use() with exclude()
- fix(core): warn that filter classes bound to a middleware do not apply
- fix(core): reject a middleware target that is not a controller or route — such an entry now fails the application at startup
- fix(core): mount module middleware in order when configure() awaits
- fix(core): resolve a forward reference to a module only once
- fix(core): mount a controller root route without the slash after a tail
- fix(core): mount middleware on a route path that really ends in "$"
- fix(core): keep create() working after many calls in snapshot mode
- fix(core): give unserializable dynamic modules their own deep-hash ids
- fix(core): build a lazy module once when loads overlap
- fix(core): fail the consumer when an optional dependency fails to load
- fix(core): keep transient instances out of durable sub-trees
- fix(core): inject the strategy payload into durable providers as request
- fix(core): inject the provider an alias stands for
- fix(core,websockets): read parameter metadata from the declaring class
- fix(core,common): read the catch types of a filter from its prototype
- fix(core): warn when a validation pipe gets no parameter types
- fix(core): use the enhancers of the module that holds the host
- fix(core): run the container instance of a class-bound enhancer
- fix(core): throw for a guard, interceptor or pipe that can't run — such a binding now fails the application at startup
- fix(core,microservices,websockets): drop gateway clients during startup
- fix(core): warn about an exception filter that can't run
- fix(core): settle sse lifecycle on early disconnect — backport of #17987
- fix(core): let exclusions cover routes excluded from the global prefix — backport of #18209
- fix(core): compare a prefix exclusion with a trailing slash as served
- fix(core): release the throwaway wrapper of each create() call — backport of #18137
- fix(core): reject create() when a dependency is request-scoped — backport of #18142
- fix(core): find the module of a host registered under another token
- fix(core): roll back modules on failed lazy load — backport of #18385
- fix(core): reject create() when a property dependency is request-scoped
- fix(core): release removed wrappers from the providers they depended on
- fix(core): use the enhancers of the module that holds the host
- fix(core): recompute scope flags cached inside a circular dependency
- fix(core): await deferred loads of forward-referenced providers
- fix(core): stop reusing durable instances holding a failed placeholder
- fix(core): stop reloading durable instances marked by a failed load
@nestjs/platform-express- fix(express,node): default the multipart parts limit to 1000 — multipart requests default to at most 1000 parts; raise
limits.partsfor more - fix(express,fastify,node): keep module upload options a route leaves out
- fix(express,fastify,node): fail the request when an upload filter throws
- fix(express,fastify,node): cut off an upload once the response is sent
- fix(express,fastify,node): close the array gaps of multipart bodies
- fix(express): render a copy of the value a handler returns
- fix(express): map only client syntax and uri errors to 400
- fix(express): answer a failed file stream with plain text
- fix(express): release file streams of pipelined requests on close
- fix(express): fail an object-mode file stream on a non-bytes chunk
- fix(express): remove rejected uploads of pipelined requests on close
- fix(express): send the standard body for an exception wrapping an error — backport of #18199; an
Errorbody sent with an error status gets the standard body of the status
- fix(express,node): default the multipart parts limit to 1000 — multipart requests default to at most 1000 parts; raise
@nestjs/platform-fastify- fix(fastify): handle a failed file stream on a raw response
- fix(fastify): release file streams of pipelined requests on close
- fix(fastify): fail an object-mode file stream on a non-bytes chunk
- fix(fastify): track plugin contexts when the app registers middie
- fix(fastify): handle "proto" in urlencoded bodies like json ones
- fix(fastify): lower-case middleware paths like a case-insensitive router
- fix(fastify,node): match middleware in the forms the router decodes
- fix(fastify): handle async body parsers and app.use() middleware errors
- fix(fastify): treat an empty repeated route parameter as a route miss
- fix(fastify): serve the webdav and search methods with @all() routes —
@All()declared above one of these methods on the same path now fails at startup - fix(fastify): match routes whose parameter names the router misreads
@nestjs/microservices- fix(microservices,websockets): scope parameter pipes to each context — backport of #18487
- fix(microservices): handle a cancelled rmq reply consumer in client — backport of #18499
- fix(microservices): limit the size of rmq messages decoded as json — new
maxMessageSizeoption, 16 MiB by default - fix(microservices): validate kafka and rmq request ids before echoing
- fix(microservices): reject rmq short strings longer than 255 bytes
- fix(microservices): skip rmq wildcard matching for over-long patterns
- fix(microservices): stop kafka servers from keeping streamed replies
- fix(microservices): keep the kafka consumer running after type errors
- fix(microservices): log kafka entries that json cannot serialize
- fix(microservices): send kafka events and replies without reply headers
- fix(microservices): refuse kafka reply topics the server handles itself
- fix(microservices): check the routing key of rmq wildcard messages
- fix(microservices): send objects with other fields as kafka payloads — an object with
keyorvalueand other fields is sent as the payload - fix(microservices): end grpc client stream calls cancelled early
- fix(microservices): send grpc error messages that are not strings
- fix(microservices): fail grpc streams whose client leaves replies unread — new
maxPendingResponsesoption, 1000 by default - fix(microservices): fail grpc client calls whose requests emit null
- fix(microservices): print the id of an unmatched redis reply safely
- fix(microservices): count redis requests that wait for the subscription
- fix(microservices): match mqtt wildcard filters against the sent topic
- fix(microservices): reject mqtt topic names with wildcards in clientmqtt
- fix(microservices): skip nest replies arriving on nats handler subjects
- fix(microservices): log handler failures of grpc stream calls
- fix(microservices): lower the default tcp maxbuffersize to 16 mi — TCP packets over 16 Mi characters are refused unless
maxBufferSizeis raised - fix(microservices): use the default tcp and kafka limits for nan
- fix(microservices): apply the tcp maxbuffersize to each packet
- fix(microservices): flatten the tcp packet buffer after many small reads
- fix(microservices): listen on localhost for an empty tcp host option — set
host: '0.0.0.0'to listen on every interface - fix(microservices): end streams of tcp messages emitted without an id
- fix(microservices): bound how many messages of a tcp peer are handled — new
maxConcurrentMessagesoption, 1000 per connection by default - fix(microservices): apply the pattern limits before serializing it
- fix(microservices): use the default filter when an rpc filter fails
- fix(microservices): observe the promises of joined event handlers
- fix(microservices): run scoped filters for controller resolution errors
- fix(microservices): sort non-ascii pattern keys without localecompare — patterns with non-ASCII keys may get a new route, so clients and servers of such patterns should be on the same version
- fix(microservices): skip scoped global filters not created for a context
- fix(microservices): wait for every pipe of a message before failing it
- fix(microservices): fail requests whose reply subscription is rejected — backport of #17671
- fix(microservices): fail pending rmq requests on client close — backport of #17786
- fix(microservices): undo a request whose publish threw — backport of #17822
- fix(microservices): bound how long a tcp packet may take to arrive — new
messageReceiveTimeoutoption, 300 s by default - fix(microservices): route rmq requests with the pattern the server binds — backport of #18459
- fix(microservices): fail pending rmq requests when the connection drops — backport of #18491
- fix(microservices): count redis requests that wait for the subscription
@nestjs/websockets- fix(websockets,ws,socket.io): free a client's last handled message
- fix(websockets): share one host between gateways of a namespace
- fix(websockets): keep the options of a gateway whose port is not set
- fix(websockets): wait for every pipe of a message before failing it
- fix(websockets): count a message as handled until its filter is done
- fix(websockets,socket.io): stop echoing binary data in error replies
- fix(websockets): share streams of gateways on "/" and on no namespace
- fix(websockets): refuse a gateway whose connection check would not run — this now stops the application at startup
- fix(websockets,ws,socket.io): open no port for a gateway without one — in a standalone microservice, a gateway without a port no longer listens
@nestjs/platform-ws- fix(ws): leave upgrade requests for other paths to other listeners — backport of #18501
- fix(ws): limit the size of the messages a client may send —
WsAdaptercloses a client that sends a message over 1 MB (code 1009); raise it with the adapter's or the gateway'smaxPayload - fix(ws): keep a client paused while any gateway on it is backlogged
- fix(ws): notice a paused client that has left
- fix(ws): refuse a client whose upgrade check throws
- fix(ws): refuse gateways on one port that set different hosts — this now stops the application at startup
- fix(ws,socket.io): use the default for adapter limits given as nan
@nestjs/platform-socket.io- fix(socket.io): cap how many messages of a client wait for their turn — new
IoAdapteroptionmaxWaitingMessages, 10,000 by default
- fix(socket.io): cap how many messages of a client wait for their turn — new
Full Changelog: v11.2.9...v11.2.10