fix(client): XGROUP CREATE/SETID with ENTRIESREAD 0 must emit the argument#3333
Merged
Merged
Conversation
…ument `XGROUP CREATE`/`XGROUP SETID ... ENTRIESREAD 0` was guarded by a truthy check (`if (options?.ENTRIESREAD)`), so an explicit `0` was silently dropped and the entries-read counter was left unset instead of being set to 0. `ENTRIESREAD 0` is a valid value (a consumer group that has read zero entries, e.g. resetting the group's lag tracking), so guard on `!== undefined` so `0` is forwarded, matching the recent XSETID ENTRIESADDED 0 fix (redis#3324). Adds an `ENTRIESREAD 0` argument test for both commands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nkaradzhov
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
XGROUP CREATE key group id ENTRIESREAD 0andXGROUP SETID key group id ENTRIESREAD 0silently drop theENTRIESREADargument when the value is0. Both argument builders guard it with a truthy check (if (options?.ENTRIESREAD)), so an explicit0never reaches the server.ENTRIESREAD 0is a valid value: it sets a consumer group's entries-read counter (used for lag tracking) to zero, for example when resetting the group. With the current code the argument is omitted, so the counter is left unset instead of0.The fix guards on
!== undefinedin bothXGROUP_CREATEandXGROUP_SETID, so an explicit0is forwarded. This matches the recentXSETID ENTRIESADDED 0fix (#3324) andRESTORE IDLETIME/FREQ 0(#3323).Added an
ENTRIESREAD 0transformArgumentstest to both command specs.Checklist
eslint --max-warnings=0), type-check (tsc --build), and thetransformArgumentsunit tests pass locally. The fullnpm testintegration suite runs against Dockerized Redis, which I don't have set up locally, so I relied on CI for that.ENTRIESREAD 0argument tests for both commands.Note
Low Risk
Small argument-building fix with added unit tests; no auth, data, or API contract changes beyond correct command encoding.
Overview
XGROUP CREATE and XGROUP SETID no longer drop
ENTRIESREADwhen the value is0. Both commands now appendENTRIESREADwhenever the option is set (!== undefined) instead of using a truthy check, so resetting the consumer group entries-read counter to zero reaches Redis as intended.Unit tests assert that
transformArgumentsincludesENTRIESREAD'0'for both commands.Reviewed by Cursor Bugbot for commit d3904d4. Bugbot is set up for automated code reviews on this repo. Configure here.