Skip to content

fix(client): correct CLUSTER BUMPEPOCH reply type - #3414

Open
abhijeet117 wants to merge 1 commit into
redis:masterfrom
abhijeet117:fix/cluster-bumpepoch-reply-type
Open

fix(client): correct CLUSTER BUMPEPOCH reply type#3414
abhijeet117 wants to merge 1 commit into
redis:masterfrom
abhijeet117:fix/cluster-bumpepoch-reply-type

Conversation

@abhijeet117

@abhijeet117 abhijeet117 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

CLUSTER BUMPEPOCH replies the simple string "BUMPED <epoch>" or "STILL <epoch>" (cluster_legacy.c formats it with sdscatprintf), but the reply was typed as the literal union 'BUMPED' | 'STILL'. Code like reply === 'BUMPED' compiled while never matching at runtime because the epoch is always appended. The reply is now declared as a plain string, matching CLUSTER_REPLICATE and the existing runtime assertion in the spec.

Testing

Compile-time regression test asserts the client-facing reply type equals string and is not the bare literal union; it fails before this change and passes after (npm run test:types -w @redis/client). lint:changed and the client package build pass. Runtime behavior is unchanged; the existing spec already asserts typeof reply === 'string'.

Checklist

  • Bug reproduced before fix
  • Root cause identified
  • Bug fixed
  • Tests passed

Note

Low Risk
Type-only correction for one cluster command reply; no runtime or security changes.

Overview
Fixes the TypeScript reply type for CLUSTER BUMPEPOCH. Redis returns "BUMPED <epoch>" or "STILL <epoch>", but the client typed the reply as the bare literals 'BUMPED' | 'STILL', so checks like reply === 'BUMPED' type-checked while never matching at runtime.

The command now uses a plain SimpleStringReply. A compile-time types test asserts the client-facing type is string and not the old literal union. Runtime behavior is unchanged.

Reviewed by Cursor Bugbot for commit 15ca6b4. Bugbot is set up for automated code reviews on this repo. Configure here.

@PavelPashov

Copy link
Copy Markdown
Contributor

@abhijeet117 Thanks for the PR. We’ll review it when we have capacity.

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.

2 participants