← 输入框|github.com|刷新
Skip to content

fix(client): preserve empty XPENDING consumer filters - #3494

Merged
nkaradzhov merged 1 commit into
redis:masterfrom
wToTw123:codex/fix-xpending-empty-consumer
Oct 8, 2026
Merged

nkaradzhov merged 1 commit into
redis:masterfrom
wToTw123:codex/fix-xpending-empty-consumer

Conversation

@wToTw123

@wToTw123 wToTw123 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

xPendingRange(..., { consumer: '' }) drops the consumer filter because the parser tests truthiness. Check against undefined to preserve an empty name, consistent with an empty Buffer, and clarify the option's JSDoc. Omitted and undefined consumers remain omitted.

Add ten argument regressions covering strings, Buffers, zero IDLE, and omitted/undefined consumers. The two empty-string cases fail before the fix; all ten pass afterward.

Validation:

  • Ubuntu 24.04 matrix: all ten Node 20/22 × upstream Redis image jobs passed, including builds, changed-file lint, command JSDoc, 36 offline tests, 20 live RESP2/RESP3 cases per job, and the full workspace Docker suite with upstream Redis flags. The validation tree matches this PR's source tree, with only the extra validation workflow/script omitted from the PR.
  • The upstream image labels are 7.4/8.2/8.4/8.8/8.10; the 8.10 development image reports Redis 8.9.241. Suite-reported pending tests are preserved in the logs.
  • Windows Node 20.20.2 and 22.23.3: regressions, related tests, forced workspace build, client type tests, changed-file ESLint, and command JSDoc pass on the same base 5033f59.

This is a source-discovered, isolated bug fix; no existing issue is being claimed. OpenAI Codex assisted with investigation, code, tests, and this description.


Checklist

  • Does npm test pass with this change (including linting)? The full workspace suite and changed-file lint pass in all ten cloud jobs, using the same cleanup/workspace commands as root npm test with upstream Redis flags.
  • Is the new or changed code fully tested? Ten argument regressions and twenty live RESP2/RESP3 cases cover the changed behavior.
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)? The consumer option JSDoc now includes empty names; no API is added.

Note

Low Risk
Isolated XPENDING RANGE argument serialization fix with new regression tests; no auth, data, or broader API changes.

Overview
Fixes xPendingRange so an explicit consumer: '' (or empty Buffer) is still sent to Redis instead of being dropped by a truthy check.

The parser now appends the consumer only when options.consumer !== undefined, matching behavior for omitted/undefined consumers and aligning with IDLE: 0 handling. JSDoc notes that empty consumer names are valid.

Adds argument-parsing regressions for empty/nonempty strings and buffers, with and without IDLE: 0, plus cases where the consumer is omitted or undefined.

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@nkaradzhov nkaradzhov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, LGTM

@nkaradzhov
nkaradzhov merged commit bfe2202 into redis:master Oct 8, 2026
15 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.

2 participants