Default Resp3#3215
Conversation
e4d84b7 to
311595a
Compare
| ); | ||
| } | ||
|
|
||
| object[key] = value; |
There was a problem hiding this comment.
Should we use Object.defineProperty here?
| default: | ||
| return this.#decodeMapAsObject( | ||
| Object.create(null), | ||
| {}, |
There was a problem hiding this comment.
Could this cause issues if the server returns a __proto__ key in a map? Related to this comment
There was a problem hiding this comment.
Yes, and we added this type of change to the v5-to-v6 migration doc
| const RESP = (options.clusterConfiguration?.RESP ?? 3) as RESP; | ||
| const { | ||
| RESP: _RESP, | ||
| minimizeConnections = false, |
There was a problem hiding this comment.
Is minimizeConnections: false intentional?
| parseCfInsertArguments(...args); | ||
| }, | ||
| transformReply: INSERT.transformReply | ||
| transformReply: undefined as unknown as () => ArrayReply<NumberReply<-1 | 0 | 1>> |
There was a problem hiding this comment.
This might break the old RESP 2 responses as now it will return numbers instead of booleans for both protocols.
There was a problem hiding this comment.
that is intentional, documented in v5-to-v6
There was a problem hiding this comment.
Sorry, i see what you mean. This actually breaks the RESP 2, but we know that the server is in fact returning number in both resp2 and resp3. so its more of a fix for resp2. So i would keep it like this
| if (Array.isArray(rawReply)) { | ||
| return transformAggregateReplyResp2(rawReply as unknown as AggregateRawReply, preserve, typeMapping); | ||
| } |
There was a problem hiding this comment.
Could this break RESP3 clients using RESP_TYPES.MAP: Array, since map replies decode as flat arrays and would be parsed as RESP2 here?
There was a problem hiding this comment.
true, has to be fixed
| if ( | ||
| key === "id" || | ||
| key === "values" || | ||
| key.toLowerCase() === "extra_attributes" || | ||
| key === "extraAttributes" | ||
| ) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Will this stop working for RESP2, because we'll still need to JSON.parse there?
There was a problem hiding this comment.
JSON.parse still runs — it just moved into parseDocumentValue → assignDocumentField.
Worth adding a JSON test though.
|
Suggestion: Should we add a |
- Add RESP2 vs RESP3 structural assertions across command specs. - Consolidate duplicate, renamed, and flaky test cases in one pass. - Keep this commit spec-only to isolate test intent.
- Switch default RESP behavior to RESP3 across client entry points. - Align cluster and sentinel command paths with RESP3 defaults. - Keep compatibility normalization and module fixes for later commits.
- Normalize cross-module reply-shape handling for RESP2 and RESP3. - Apply shared parser and transformer updates for stable compatibility. - Leave targeted module bugfixes isolated for the next commit.
- Fix GEO float reply handling across geosearch-compatible paths. - Fix Bloom CF.INSERTNX status handling and Search PROFILE parsing edge cases. - Fix TimeSeries MRANGE selected-label/groupby compatibility behavior.
generic-transformers.spec.ts was newly uncommented and needed some assertion updates
- refactor(streams): share RESP3 compat transformer across XREAD/XREADGROUP - test-utils: restore pre-resp3 testWithCluster minimizeConnections default - fix(search): handle FT.AGGREGATE RESP3 reply under typeMapping[MAP]=Array - test(search): cover FT.HYBRID JSON-doc reply for RESP2 and RESP3
Replace hardcoded `?? 3` defaults with a named DEFAULT_RESP constant exported from @redis/client. Covers all runtime fallback sites in client/, sentinel/, cluster/, commander, legacy-mode, and the test-utils helpers. TS generic defaults, JSDoc examples, and explicit per-test RESP pins are intentionally left as literals.
the value depends on which 3s you mean:
|
transformStreamsMessagesReplyResp3Compat now matches the TransformReply contract and propagates typeMapping into the inner Resp3 transform. transformStreamsMessagesReplyResp3 accepts and forwards typeMapping to transformStreamMessagesReply in every branch, and the V4-compat path in transformStreamsMessagesReplyResp2 does the same — so XREAD/XREADGROUP message bodies now honor RESP_TYPES.MAP like XRANGE does. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 25b36fb. Configure here.

Description
Checklist
npm testpass with this change (including linting)?Note
Medium Risk
Changes the default wire protocol to RESP3 and adjusts multiple command reply transforms/types (including object prototype normalization), which can break consumers relying on RESP2 defaults or exact reply shapes/prototypes.
Overview
RESP3 (
RESP: 3) is now the default acrosscreateClient/cluster/pool/legacy paths via a new exportedDEFAULT_RESP, with option validation and maintenance/client-side-cache behavior updated soRESPomitted implies RESP3.Stabilizes and normalizes previously unstable RESP3 transforms by removing the
unstableResp3gating and adding concrete RESP3 transforms for commands likeHOTKEYS GET,XREAD/XREADGROUP(now v4/v5-compatible list shape), andMODULE LIST(handles array/map/object variants).Normalizes map/object decoding and various command transforms to return plain objects instead of
Object.create(null), and aligns reply typing/behavior changes including GEOWITH*distance/coordinates asnumberandCF.INSERTNXreturningArray<number>.Adds a v5→v6 migration guide and updates/extends unit/integration tests to assert the new RESP3-default behaviors and reply structures.
Reviewed by Cursor Bugbot for commit 25b36fb. Bugbot is set up for automated code reviews on this repo. Configure here.