v6.1.0
✨ Highlights
This release adds smart client handoffs: the client listens for Redis maintenance notifications, relaxes command and socket timeouts while maintenance is in progress and moves connections to the new endpoint, so planned upgrades and failovers on Redis Enterprise and Redis Cloud cause fewer errors. Cluster sharded Pub/Sub gets a health check that detects subscribers which stop receiving messages and reconnects them. The command set grows with the Redis 8.12 set member expiration, sorted set move,BITRANGEINTARRAY and BLESS commands. Many fixes land for reconnection, the selected database, Cluster pipelines and autopipelining, Sentinel and RESP3 decoding.
🚀 New Features
- client: smart client handoffs, which handle Redis maintenance notifications with the
maintNotifications,maintEndpointType,maintRelaxedCommandTimeoutandmaintRelaxedSocketTimeoutoptions (#2165) - cluster: add a health check for sharded subscribers, configured with
shardedSubscriberHealthCheckInterval(default10000ms,nulldisables it) (#2268) - cluster: add the
subscriberNodeRoleoption to choose the node role for the Pub/Sub subscriber (#2176) - commands: add the set member expiration commands
SADDEX,SEXPIRE,SEXPIREAT,SEXPIRETIME,SPERSIST,SPEXPIRE,SPEXPIREAT,SPEXPIRETIME,SPTTLandSTTL(Redis 8.12) (#2261) - commands: add the sorted set move commands
ZMOVE,BZMOVEandZMOVEMEMBER(Redis 8.12), withBZMOVEhandled as a blocking command (#2288) - commands: add
BITRANGEINTARRAY(Redis 8.12) (#2279) - commands: add the BLESS command family (Redis 8.12) (#2209)
🐛 Bug Fixes
Connection and reconnection
- End the client when
quit()ordisconnect()is called while reconnecting (#2245) - Reset retry attempts when
connect()is called after the client gave up (#2204) - Reset the manual close state when
connect()is called afterend(#2250) - Reject unfulfilled commands dropped on reconnect (#2194)
- Handle rejections from auto-resubscribe and
SELECTon reconnect (#2187) - Close the monitor connection when
monitor()rejects (#2247)
Selected database
- Keep the selected database for commands queued while reconnecting (#2235)
- Restore the database selected by a non-lowercase
SELECTafter reconnecting (#2248) - Handle a rejection from the database-restoring
SELECTonreconnectOnError(#2229)
Cluster lifecycle
- Fix the cluster getting stuck in
close(#2217) - End when
quit()ordisconnect()is called while reconnecting (#2240) - Stay ended when nodes removed by
disconnect()end late (#2237) - Stop refreshing slots when
disconnect()is called during a refresh (#2249) - Do not fall back to a replica when no primary is left (#2275)
- Map every slot when
stringNumbersis enabled (#2255) - Pass the retry delay to the
reconnectingevent (#2291)
Cluster pipelines and autopipelining
- Resend only the redirected command in a pipeline (#2214)
- Do not reject pipeline commands for connecting nodes when the offline queue is disabled (#2277)
- Do not throw when autopipelining meets an uncached slot (#2233)
- Bucket autopipelined
MSETobjects by their first key (#2207) - Hash autopipelined
Bufferkeys by their bytes (#2208) - Hash lone surrogates as the UTF-8 that Node sends (#2242)
- Vendor
cluster-key-slotto fix the slot of keys with an empty hash tag (#2172) - Align autopipeline callbacks for dynamic commands (#2180)
Cluster Pub/Sub
- Keep forwarding sharded messages after reconnecting from
end(#2251) - Support a zero-argument
SUNSUBSCRIBEwith sharded subscribers (#2137) - Match
Buffershard channels when unsubscribing (#2203) - Emit sharded subscriber connect errors silently (#2241)
- Inherit
connectTimeoutfor cluster subscribers (#2220)
Sentinel
- Retry unreachable sentinels in a loop instead of recursing (#2270)
- Correct the retry order after node connection failures (#2246)
- Handle errors on failover detector connections (#2257)
- Clean up failover subscriptions after
quit()(#2198)
Pub/Sub
- Keep subscriber mode while other channel kinds remain subscribed (#2196)
- Resolve an argument-less
UNSUBSCRIBE/PUNSUBSCRIBEonce its own kind is empty (#2238)
RESP and replies
- Decode RESP3 attribute replies instead of failing the connection (#2213)
- Decode RESP3 doubles with
Number(#2150) - Decode integer replies up to
Number.MAX_SAFE_INTEGERexactly (#2164) - Keep
String.prototypein fast mode after definingVerbatimString(#2206) - Apply the legacy reply shape to uppercase command names (#2252)
Commands and errors
- Redact credentials from the command attached to errors (#2231)
- Keep the
exec()error out of its ownpreviousErrors(#2218) - Preserve empty keys and
MATCHpatterns in scan streams (#2199)
Types
- Accept field arrays in
hmget/hmgetBuffer(#2167) - Accept
string | string[]fordel(#2230) - Allow a number for the
zrangestop argument (#2163) - Accept the documented TLS profile options (#2195)
- Add event overloads to the
Clusterinterface (#2201) - Add
smessageandsmessageBufferevent overloads (#2191)
🧰 Maintenance
- ci: publish to npm with trusted publishing and staged approval, and run the release job in the
Releaseenvironment (#2226, #2303) - ci: update the Redis 8.12 test image (#2273, #2287)
- test: run the standard functional suite against an external Redis Enterprise database and skip incompatible suites (#2140, #2177)
- test: add regression coverage for a deeply nested reply, subscribing during connect and
+switch-masterduring Sentinel rediscovery (#2138, #2202, #2293) - test: tolerate early timer firing in timeout relaxation baselines (#2232)
- docs: explain per-master cluster key scanning, fix multi-node cluster examples and correct the
slotsRefreshIntervaldefault (#2295, #2271, #2236) - docs: clarify Sentinel TLS options, list all built-in argument transformers and explain custom script inheritance in duplicate connections (#2292, #2290, #2225)
- docs: update the contribution guidelines (#2188)
- chore: remove the
CLAUDE.mdsymlink in favour ofAGENTS.mdand remove the maintainer-review agent skill (#2200, #2244) - deps: bump
undici,brace-expansion,serialize-javascript,mocha,handlebars,js-yaml,browserslistand@babel/core(#2173, #2175, #2179, #2184, #2185, #2210, #2216, #2224, #2263, #2265) - deps: bump
express,body-parser,qs,morganandproxy-addrinexamples/express(#2174, #2183, #2211, #2223, #2234, #2264)
Full Changelog: v6.0.0...v6.1.0