stipsan / ioredis-mock

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

MGET and MSET behaviour differs from ioredis #1039

Open kamilkijak opened 3 years ago

kamilkijak commented 3 years ago

mget() doesn't throw an error when for an empty array (which is the default behaviour in ioredis).

This library is used to mimic ioredis which means we should throw an error for an empty array (even though it's less intuitive in my opinion, there was a related discussion in https://github.com/luin/ioredis/issues/419).

There's an equivalent problem for mset().

renatocron commented 1 year ago

I observed an additional distinct behavior:

ioredis library accepts both mset(['key', 'value']) and mset(...['key', 'value']) as valid inputs. However, when I switched to using ioredis-mock, only the latter version worked correctly. The former method led to arbitrary number keys being erroneously written to the memory.