redis-rb/redis-client

command_builder should should allow SADD to pass an array as an argument

Closed this issue · 6 comments

jpaas commented

Using 0.11.2 when using the SADD command, if I pass an array as an argument I get this error: Unsupported command argument type: Array because he argument validation in command_builder does not allow this.

Fix is trivial. PR to follow.

Would you mind showing the code that cause this error?

>> RedisClient.new.call("SADD", "set", ["a", "b"])
=> 2

The above works just fine, so I assume you have deeply nested arrays? If so they're rejected on purpose.

jpaas commented

Oh maybe you're right. They might be placing their array of job ids in an array. In fact they made this change recently on Sep 28.

breamware/sidekiq-batch@6c4ca7e

Yup, they should flatten that.

The reason I don't want to allow nested arrays is that most of the time it's not intended. redis-client tries to be strict to avoid silent issues.

jpaas commented

Thanks @casperisfine. I'll take this up with sidekiq-batch