1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

fix(client): make unstable cmds throw (#2990)

As per the docs, unstableResp3 commands should throw
when client is created with { RESP: 3, unstableResp3: false|undefined }

fixes #2989
This commit is contained in:
Nikolay Karadzhov
2025-06-06 15:38:52 +03:00
committed by GitHub
parent ca91718b59
commit 62ac8b7c32
4 changed files with 72 additions and 3 deletions

View File

@@ -38,7 +38,11 @@ export function attachConfig<
Class: any = class extends BaseClass {};
for (const [name, command] of Object.entries(commands)) {
Class.prototype[name] = createCommand(command, RESP);
if (config?.RESP == 3 && command.unstableResp3 && !config.unstableResp3) {
Class.prototype[name] = throwResp3SearchModuleUnstableError;
} else {
Class.prototype[name] = createCommand(command, RESP);
}
}
if (config?.modules) {