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

invite.exists returns more results than invite.pending + invite.accepted + invite.rejected

Open Jan-Stepien opened this issue 1 year ago • 4 comments

Which packages are you using?

stream_chat

On what platforms did you experience the issue?

iOS, Android

What version are you using?

stream_chat: ^6.6.0

What happened?

when calling await _chatClient.queryChannelsOnline(

with

filter: stream.Filter.exists('invite'),

and

filter:  stream.Filter.or(
    [
        stream.Filter.equal('invite', 'pending'),
        stream.Filter.equal('invite', 'accepted'),
        stream.Filter.equal('invite', 'rejected'),
    ],
)

returns different results - meaning there is more values to query for in terms of invite parameter ( not shown by the documentation)

Steps to reproduce

Call await _chatClient.queryChannelsOnline(filter: stream.Filter.exists('invite'),)

and

await _chatClient.queryChannelsOnline(
    filter:  stream.Filter.or(
        [
             stream.Filter.equal('invite', 'pending'),
             stream.Filter.equal('invite', 'accepted'),
             stream.Filter.equal('invite', 'rejected'),
        ],
    ),
);
  1. compare result sets

filter: stream.Filter.exists('invite') returns more results than

filter:  stream.Filter.or(
    [
        stream.Filter.equal('invite', 'pending'),
        stream.Filter.equal('invite', 'accepted'),
        stream.Filter.equal('invite', 'rejected'),
    ],
)

Which leads me into thinking that there are more statuses that are not exposed.

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

No response

Flutter doctor output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Jan-Stepien avatar Nov 28 '23 14:11 Jan-Stepien

Whats the status on this one? Its pending invite implementation blocker issue

Jan-Stepien avatar Jan 26 '24 11:01 Jan-Stepien

This issue is stale because it has been open for 20 days with no activity.

github-actions[bot] avatar Feb 20 '24 01:02 github-actions[bot]

Hey @Jan-Stepien , looking into this, I am sorry for the delay.

esarbanis avatar Feb 21 '24 13:02 esarbanis

No worry @esarbanis is there any way i can help you or is it clear?

Jan-Stepien avatar Mar 04 '24 12:03 Jan-Stepien

Hey @Jan-Stepien 👋

After checking with the backend team, the invite.exists filter is not the appropriate filter to use for checking for all invite states. The second filter you used is the correct one in this scenario. Invites were not meant to be checked with the exists filter and the newer backend query parser throws an error when this is used.

Hope this helps - closing this for now. Thanks!

deven98 avatar Jun 17 '24 11:06 deven98