feat(ratelimit, lock)!: drop Redis cluster client support - #2075
Conversation
RedisRateLimiter and RedisLocker typed their client as a union with RedisClusterType<any, ...>, but node-redis cluster types are invariant in their generics, so a cluster client stored in a variable never compiled. Lazy connect also raced on clusters: a cluster is open before it discovers its nodes, so concurrent first calls failed with "The client is offline". Both adapters now accept standalone clients only, and the docs no longer claim cluster support. Cluster support was never released.
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/experimental-msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Adapter types:
RedisLockerandRedisRateLimiterconstructors now acceptRedisClientTypeonly; theRedisClusterTypeunion and its import are dropped. - Docs:
ratelimit.mdxandlock.mdxno longer advertise cluster-client support.
The runtime path (base-redis.ts lazy connect + eval) is untouched and the narrowing behaves as described — I confirmed standalone createClient() is accepted while createCluster() is now rejected, and both package type checks plus ESLint pass.
ℹ️ "Nothing released is affected" overstates the situation
The PR body justifies removing cluster support with "cluster support landed after v2.0.0-beta.34." It did land after beta.34, but it also shipped: #2014 merged 2026-09-12 and #2016 merged 2026-09-14, so v2.0.0-beta.36 (2026-09-16) through v2.0.0-beta.40 (2026-09-23) were released with it. The accurate justification for "no released user is affected" is the first one in the body — the feature never worked — not that it was unreleased.
Technical details
# Release timeline
## Affected sites
- PR #2075 description — "Nothing released is affected, since cluster support landed after v2.0.0-beta.34."
## Required outcome
- No code change. If the release narration matters (auto-generated release notes, migration docs), base the claim on the feature being non-functional rather than on it being unreleased.
## Evidence
- `v2.0.0-beta.34` = 2026-09-07 (27697d28).
- #2014 (ratelimit cluster support), merge commit `9c1a969f`, merged 2026-09-12.
- #2016 (lock helpers), merge commit `fe46f02f`, merged 2026-09-14.
- `v2.0.0-beta.36` = 2026-09-16 — first release after both merges; the support was published through `v2.0.0-beta.40` (2026-09-23).DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

RedisRateLimiterandRedisLockernow accept standalone node-redis clients only, and the docs no longer claim cluster support. The cluster support added in #2014 and #2016 did not work in practice: a cluster client stored in a variable failed to compile, and concurrent first calls on a lazily connected cluster failed with "The client is offline". Nothing released is affected, since cluster support landed after v2.0.0-beta.34.Fixes
Testing
withTypeMapping, bareRedisClientType) type-check against both adapters. Cluster clients are rejected at compile time.