Skip to content

Commit

Permalink
fix redis#1854 - fix __redis__:invalidate messages handler (redis#1856)
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale authored Jan 24, 2022
1 parent cf120c3 commit 551d204
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/client/lib/client/commands-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ export default class RedisCommandsQueue {

if (!listeners.strings.size) return;

// https://github.com/redis/redis/pull/7469
// https://github.com/redis/redis/issues/7463
const messageString = (Array.isArray(message) ? message.map(m => m.toString()) as any : message.toString()),
channelString = pattern ? channel.toString() : keyString;
const channelString = pattern ? channel.toString() : keyString,
messageString = channelString === '__redis__:invalidate' ?
// https://github.com/redis/redis/pull/7469
// https://github.com/redis/redis/issues/7463
(message === null ? null : (message as any as Array<Buffer>).map(x => x.toString())) as any :
message.toString();
for (const listener of listeners.strings) {
listener(messageString, channelString);
}
Expand Down

0 comments on commit 551d204

Please sign in to comment.