fix(client): default RESP to RESP2#3301
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 34c322a. Configure here.
| }); | ||
| }, | ||
| 2: (reply: Array<Array<BlobStringReply | NumberReply | NullReply>>) => | ||
| reply.map(group => transformTuplesReply(group as unknown as ArrayReply<BlobStringReply>)) as unknown as XInfoGroupsReply['DEFAULT'], |
There was a problem hiding this comment.
XINFO_GROUPS integration test broken by prototype and property changes
Medium Severity
Switching transformReply[2] to use transformTuplesReply changes the returned objects in two ways that break the existing integration test: (1) objects now have a null prototype (via Object.create(null)) instead of Object.prototype, and (2) for Redis versions below 7.0, the entries-read and lag keys are absent rather than present with value undefined. The integration test uses assert.deepStrictEqual (via strict as assert) which checks prototype equality, so comparing a null-prototype actual against a plain object expected will throw. The new unit tests correctly use Object.assign(Object.create(null), {...}), but the unchanged integration test does not.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 34c322a. Configure here.


Summary
Validation
pm run build
pm run lint (changed files)
Note: lint:changed reports existing lint issues in these files (not introduced by this change).
Note
Low Risk
Mostly TypeScript defaults and RESP2 reply shaping; runtime wire behavior for typical clients should stay RESP2 unless callers opt into RESP3.
Overview
Default protocol version:
RedisClientOptionsnow defaults theRESPgeneric to2instead of the fullRespVersionsunion, matching runtime behavior (RESP ?? 2on the command queue).Typing follow-through:
parseOptions/parseURL, Enterprise Maintenance Manager, and Sentinel (BroadSentinelClient,PubSubProxy<RESP>, pooled clients) are updated so internal code does not widen or mis-infer RESP when options omit an explicit version.Streams:
XINFO GROUPSRESP2 parsing now usestransformTuplesReply; reply types treatlast-delivered-idas a string and Redis 7lagas nullable, with new unit tests.Reviewed by Cursor Bugbot for commit 34c322a. Bugbot is set up for automated code reviews on this repo. Configure here.