Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying members with a filter doesn't work #132

Open
jahseng-lee opened this issue Oct 23, 2023 · 1 comment
Open

Querying members with a filter doesn't work #132

jahseng-lee opened this issue Oct 23, 2023 · 1 comment

Comments

@jahseng-lee
Copy link

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 jahseng-lee changed the title bug: client.create_token returning a token but silently failing to create a user Querying members with a filter doesn't work Oct 27, 2023
@jremmen
Copy link

jremmen commented Jun 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants