Skip to content

Commit 33adc6f

Browse files
committed
revert 2 buffer/simple string changes from experimentation
1 parent 9baec20 commit 33adc6f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/client/lib/RESP/decoder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const ASCII = {
3535
} as const;
3636

3737
export const PUSH_TYPE_MAPPING = {
38-
[RESP_TYPES.SIMPLE_STRING]: Buffer
38+
[RESP_TYPES.BLOB_STRING]: Buffer
3939
};
4040

4141
// this was written with performance in mind, so it's not very readable... sorry :(

packages/client/lib/client/commands-queue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ export default class RedisCommandsQueue {
183183
if (this.#onPush(reply)) return;
184184

185185
if (PONG.equals(reply[0] as Buffer)) {
186-
const { resolve } = this.#waitingForReply.shift()!,
186+
const { resolve, typeMapping } = this.#waitingForReply.shift()!,
187187
buffer = ((reply[1] as Buffer).length === 0 ? reply[0] : reply[1]) as Buffer;
188-
resolve(buffer.toString());
188+
resolve(typeMapping?.[RESP_TYPES.SIMPLE_STRING] === Buffer ? buffer : buffer.toString());
189189
return;
190190
}
191191
}

0 commit comments

Comments
 (0)