stipsan / ioredis-mock

Emulates ioredis by performing all operations in-memory.
MIT License
339 stars 123 forks source link

replyTransformer is not executed when `hgetAllBuffer()` is used. #947

Open ChrisKitching opened 4 years ago

ChrisKitching commented 4 years ago

Register a reply-transformer:

IORedis.Command.setReplyTransformer("hgetall", function(result) {
    console.log("RUNNING TRANSFORMER:");
    return [42];
});

IORedis will call this when either hgetall() or hgetallBuffer() is called. ioredis-mock only does it for hgetall().

You can work around this with ioredis-mock by calling setReplyTransformer() again with "hgetallBuffer" as the string argument, but this should be unnecessary.

I have not checked, but it seems likely ioredis-mock has a similar problem for all the *Buffer() ioredis functions.

antoniomuso commented 4 months ago

I have the same problem for ioredis-mock in cluster mode! In other modes, it works!