fix(client): expose watch, rbs and rbp fields in CLIENT INFO and CLIENT LIST replies - #3415
Open
abhijeet117 wants to merge 1 commit into
Open
fix(client): expose watch, rbs and rbp fields in CLIENT INFO and CLIENT LIST replies#3415abhijeet117 wants to merge 1 commit into
abhijeet117 wants to merge 1 commit into
Conversation
Contributor
|
@abhijeet117 Thanks for the PR. We’ll review it when we have capacity. |
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.
Summary
CLIENT INFO and CLIENT LIST replies silently dropped three server fields: rbs and rbp (returned since Redis 7.0) and watch (added in 7.4). catClientInfoString in networking.c emits them, but ClientInfoReply and the reply parser ignored them, so consumers could not read buffer stats or watched-key counts. They are now optional typed fields parsed with the same guarded Number() pattern as the other version-gated fields. CLIENT LIST shares the transformer, so both commands are covered.
Testing
Reproduced with a captured CLIENT INFO string containing watch=2 rbs=1024 rbp=2048: the new spec assertion failed on master (fields undefined) and passes after the fix. Parser spec, type tests, client build and eslint run locally; Docker-backed integration tests run in CI.
Checklist
Note
Low Risk
Parser-only additive fields on a read-only command; no auth, protocol, or connection-behavior changes.
Overview
Exposes three Redis client-info fields that the parser previously dropped:
watch(7.4) andrbs/rbp(7.0). They are now optional numbers onClientInfoReply, soCLIENT INFOandCLIENT LIST(which reuses the same transformer) can report watched-key counts and output-buffer stats.Adds a unit test that feeds a captured reply string and asserts the new fields parse correctly.
Reviewed by Cursor Bugbot for commit f54aea3. Bugbot is set up for automated code reviews on this repo. Configure here.