zdiff commande ignore keyPrefix
Hi,
It looks like zdiff command ignores the keyPrefix variable in the RedisOptions (inherited from CommanderOptions.) I used redis-cli monitor command to validate this. In other commands (like zrange for example) the prefix added to the key.
Example: this.redis = new Redis(redisAddress, {keyPrefix: 'myKeyPrefix:', db: redisDbIndex});
this.redis.zdiff(2, key1, key2); // in monitor: "zdiff" "2" "key1" "key2"
this.redis.zrange(key1, 0, -1); // in monitor: "zrange" "myKeyPrefix:key1" "0" "-1"
Thanks
Hi @liavsitruk 👋 ,
This is a bug that some newly added commands do not support keyPrefix well. I created a PR for this: https://github.com/luin/ioredis/pull/1610.
However, I'm not sure we should release this bugfix as a non-major version as it could break your code if you manually prefix myKeyPrefix: to zdiff. I'd like to learn how did you mitigate the issue in your code? Did you ditch keyPrefix at all or patch newly added commands manually?
Hi zihua,
Thank you for your comment. I patch newly added commands manually, so fix this bug as non major version will indeed break my code.
Hope this will help you. Thank, Liav
On Jun 25, 2022 06:29, Zihua Li @.***> wrote:
This is a bug that some newly added commands do not support keyPrefix well. I created a PR for this: #1610https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fluin%2Fioredis%2Fpull%2F1610&data=05%7C01%7Cliav.sitruk%40centrical.com%7Cb7dc3a12810c4480a12508da565ae790%7Cba06581fd8b240a09e9c8194052a8828%7C0%7C0%7C637917245704410681%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3SxLiw7x0MasMvJxCExqJTQpEwnAMmiBVLzxUYAdiDM%3D&reserved=0.
However, I'm not sure we should release this bugfix as a non-major version as it could break your code if you manually prefix myKeyPrefix: to zdiff. I'd like to learn how did you mitigate the issue in your code? Did you ditch keyPrefix at all or patch newly added commands manually?
— Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fluin%2Fioredis%2Fissues%2F1591%23issuecomment-1166181871&data=05%7C01%7Cliav.sitruk%40centrical.com%7Cb7dc3a12810c4480a12508da565ae790%7Cba06581fd8b240a09e9c8194052a8828%7C0%7C0%7C637917245704410681%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5VvkxifFTjqKSTsJ6I%2F5tKrs9BeHUdENKrRXUvvDLHg%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAOAM7XWDU5VCJJPJJANJIODVQZ4JLANCNFSM5XLK7WZA&data=05%7C01%7Cliav.sitruk%40centrical.com%7Cb7dc3a12810c4480a12508da565ae790%7Cba06581fd8b240a09e9c8194052a8828%7C0%7C0%7C637917245704410681%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zKk%2F%2FR3F%2F4cVjWOV6J2Hx%2F9P5omF7O8aRMsgrqzc3s0%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>