stream-chat-ruby icon indicating copy to clipboard operation
stream-chat-ruby copied to clipboard

Querying members with a filter doesn't work

Open jahseng-lee opened this issue 2 years ago • 1 comments

Describe the bug

channel.query_members(
  filter_conditions: { id: { "$in" => [user_id] } }
)

always returns all members when using the Ruby client. In this case user_id = SecureRandom.hex.

I've used byebug to double check a valid user_id was sent through in the filter_conditions yet I kept seeing a list of all users back.

To Reproduce

  1. Create 2 users in Stream (I used the API to create users)
  2. Use the filter_conditions: { id: { "$in" => [user_id] } } in query_members
  3. Inspect the response

Expected behavior

Only the user which matches user_id to be returned

Package version

stream-chat-ruby (3.0.0)

Desktop (please complete the following information):

  • OS: MacOS Ventura 13.2
  • Browser: Chrome
  • Version: 118.0.5993.70

Additional context

N/A

jahseng-lee avatar Oct 23 '23 05:10 jahseng-lee

I was having the same issue while following the docs. The current version takes the filter hash as the first positional arg.

query_members appears to have been introduced in version 2.4.0 with the filter_conditions kwarg, which was later changed to positional arg in 2.5.0.

jremmen avatar Jun 06 '24 23:06 jremmen