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

bug:channelList doesn't stop watching channels that we are removed from

Open kennyvallejodev opened this issue 1 year ago • 3 comments

Describe the bug

A clear and concise description of what the bug is.

  1. Render a Channel List with the filter to have us as part of the members
  2. Leave a Channel
  3. Make a User B (some other user that is not you) to send a message to this channel that you just left
  4. Now you'll see this channel popping in the list again even tho you're not part of. (Channel persists as watched even tho we are no longer part of it)

But what's funny is that if you refresh, on a initial state we don't listen on channels that we aren't part of so it solves if you refresh.

To Reproduce

Steps to reproduce the behavior:

  1. Render a Channel List with the filter to have us as part of the members
  2. Leave a Channel
  3. Make a User B (some other user that is not you) to send a message to this channel that you just left
  4. Now you'll see this channel popping in the list again even tho you're not part of. (Channel persists as watched even tho we are no longer part of it)

But what's funny is that if you refresh, on a initial state we don't listen on channels that we aren't part of so it solves if you refresh.

Expected behavior

A clear and concise description of what you expected to happen. When a channel that's on the list, we stop being part of. We shouldn't be watching that channel anymore (because is doesn't match the query anymore)

Screenshots

If applicable, add screenshots to help explain your problem.

Package version

  • stream-chat-react:^12.8.1
  • stream-chat-css:
  • stream-chat-js:^8.48.0

Desktop (please complete the following information):

  • OS: [e.g. iOS]Mac OS
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 131.0.6778.265

Smartphone (please complete the following information):

~- Device: [e.g. iPhone6]~ ~- OS: [e.g. iOS8.1]~ ~- Browser [e.g. stock browser, safari]~ ~- Version [e.g. 22]~

Additional context

Add any other context about the problem here.

kennyvallejodev avatar Jan 13 '25 22:01 kennyvallejodev

Hello @kennyvallejodev , could you please be more specific code-wise on how you 2. Leave the channel?

MartinCupela avatar Jan 14 '25 09:01 MartinCupela

My web app calls my backend (to do some specific validation and after that. the backend removes the channel member by using the method channel.removeMembers([userId], { skip_push: true });

and that's it.

is this helpful? does it affect on the current buggy behavior? should we do this different? please let us know :)

kennyvallejodev avatar Jan 14 '25 16:01 kennyvallejodev

Hey, @kennyvallejodev, thank you for clarifying, this issue is now being investigated by our BE team, I'll share an update once there's any progress. :)

arnautov-anton avatar Jan 16 '25 16:01 arnautov-anton