Skip to content

feat(ratelimit, lock)!: drop Redis cluster client support - #2075

Merged
dinwwwh merged 1 commit into
middleapi:mainfrom
dinwwwh:claude/nervous-bassi-665b5f
Sep 24, 2026
Merged

dinwwwh merged 1 commit into
middleapi:mainfrom
dinwwwh:claude/nervous-bassi-665b5f

Conversation

@dinwwwh

@dinwwwh dinwwwh commented Sep 24, 2026

Copy link
Copy Markdown
Member

RedisRateLimiter and RedisLocker now 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

  • Docs and JSDoc no longer advertise cluster clients that the types reject.
  • Standalone clients keep working unchanged. This is a type-only change, and the runtime code is identical.

Testing

  • Standalone clients (default, RESP 2 and 3, custom scripts, withTypeMapping, bare RedisClientType) type-check against both adapters. Cluster clients are rejected at compile time.
  • The ratelimit, lock, and bun type checks pass. ESLint and the JSDoc backlink checker pass.

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.
@pkg-pr-new

pkg-pr-new Bot commented Sep 24, 2026

Copy link
Copy Markdown
More templates

@orpc/ai-sdk

npm i https://pkg.pr.new/@orpc/ai-sdk@2075

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@2075

@orpc/bun

npm i https://pkg.pr.new/@orpc/bun@2075

@orpc/client

npm i https://pkg.pr.new/@orpc/client@2075

@orpc/cloudflare

npm i https://pkg.pr.new/@orpc/cloudflare@2075

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@2075

@orpc/experimental-effect

npm i https://pkg.pr.new/@orpc/experimental-effect@2075

@orpc/evlog

npm i https://pkg.pr.new/@orpc/evlog@2075

@orpc/hibernation

npm i https://pkg.pr.new/@orpc/hibernation@2075

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@2075

@orpc/experimental-lock

npm i https://pkg.pr.new/@orpc/experimental-lock@2075

@orpc/experimental-msw

npm i https://pkg.pr.new/@orpc/experimental-msw@2075

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@2075

@orpc/next

npm i https://pkg.pr.new/@orpc/next@2075

@orpc/node

npm i https://pkg.pr.new/@orpc/node@2075

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@2075

@orpc/opentelemetry

npm i https://pkg.pr.new/@orpc/opentelemetry@2075

@orpc/pinia-colada

npm i https://pkg.pr.new/@orpc/pinia-colada@2075

@orpc/pino

npm i https://pkg.pr.new/@orpc/pino@2075

@orpc/publisher

npm i https://pkg.pr.new/@orpc/publisher@2075

@orpc/ratelimit

npm i https://pkg.pr.new/@orpc/ratelimit@2075

@orpc/server

npm i https://pkg.pr.new/@orpc/server@2075

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@2075

@orpc/swr

npm i https://pkg.pr.new/@orpc/swr@2075

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@2075

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@2075

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@2075

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@2075

commit: 1e72dcc

@codecov

codecov Bot commented Sep 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 30 untouched benchmarks


Comparing dinwwwh:claude/nervous-bassi-665b5f (1e72dcc) with main (8e9a455)

Open in CodSpeed

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Adapter types: RedisLocker and RedisRateLimiter constructors now accept RedisClientType only; the RedisClusterType union and its import are dropped.
  • Docs: ratelimit.mdx and lock.mdx no 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).

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@dinwwwh dinwwwh changed the title fix(ratelimit, lock): drop Redis cluster client support feat(ratelimit, lock)!: drop Redis cluster client support Sep 24, 2026
@dinwwwh
dinwwwh merged commit a16c885 into middleapi:main Sep 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant