Skip to content

withTypeMappings not working #3055

@tqwewe

Description

@tqwewe

Description

If I create a client with the following:

this.client = createClient({
  url: this.url,
})
.withTypeMapping({
  [RESP_TYPES.BLOB_STRING]: Buffer
});

And execute a command:

await this.client.sendCommand(['MYCOMMAND']);

The provided type mappings aren't being respected.

If I put a log under the opts here:

const opts = {
...this._self._commandOptions,
...options
}

I see the options are {}, despite assigning type mappings. One hotfix was to change ...this._self._commandOptions, to ...this._commandOptions,.

This has drained a lot of hours due to my returned data not being interpreted as binary correctly.

Node.js Version

v22.17.0

Redis Server Version

Using a custom database

Node Redis Version

[email protected]

Platform

Linux

Logs

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions