Skip to content

Commit 551d204

Browse files
authored
fix #1854 - fix __redis__:invalidate messages handler (#1856)
1 parent cf120c3 commit 551d204

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ export default class RedisCommandsQueue {
8282

8383
if (!listeners.strings.size) return;
8484

85-
// https://github.com/redis/redis/pull/7469
86-
// https://github.com/redis/redis/issues/7463
87-
const messageString = (Array.isArray(message) ? message.map(m => m.toString()) as any : message.toString()),
88-
channelString = pattern ? channel.toString() : keyString;
85+
const channelString = pattern ? channel.toString() : keyString,
86+
messageString = channelString === '__redis__:invalidate' ?
87+
// https://github.com/redis/redis/pull/7469
88+
// https://github.com/redis/redis/issues/7463
89+
(message === null ? null : (message as any as Array<Buffer>).map(x => x.toString())) as any :
90+
message.toString();
8991
for (const listener of listeners.strings) {
9092
listener(messageString, channelString);
9193
}

0 commit comments

Comments
 (0)