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

Do not unsubscribe to channel realtime events on switching channels #1402

Open
nikkothari22 opened this issue Feb 25, 2025 · 1 comment
Open
Assignees

Comments

@nikkothari22
Copy link
Member

As of now:

  1. A user opens a channel -> we subscribe to real-time events for the channel.
  2. User switches channel -> we unsubscribe to real-time events for the channel
  3. Repeat

This is pretty expensive since the socketio server then makes a call to can_subscribe_doc every time we switch channels.

Instead, we should subscribe to a channel once and then not unsubscribe until either the user leaves the channel / the channel is deleted.

The only problem here is that if the user subscribes to a channel, they receive new messages in websocket events. If this user is then removed from the channel, we can't unsubscribe them from the websocket channel and they would still keep getting the new messages. Obviously this won't be shown on the UI, but might still be considered a risk?

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

No branches or pull requests

1 participant