-
Notifications
You must be signed in to change notification settings - Fork 37
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
[MM-53455] Broadcast certain call events to participants only #609
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #609 +/- ##
==========================================
+ Coverage 11.05% 16.10% +5.05%
==========================================
Files 27 38 +11
Lines 5690 6624 +934
==========================================
+ Hits 629 1067 +438
- Misses 5003 5437 +434
- Partials 58 120 +62 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be interesting to see the numbers; code looks good.
@cpoile I've pretty much redone this from scratch to work on top of the new changes, will need a new review. |
@cpoile Just a reminder this is ready for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you! I guess the only question I would have is: if we're worried about the performance implications, would it be better to add an option to the server's own method to broadcast to a slice of userIDs? (in the future of course)
Yes, ideally we'd do that to avoid some of the penalty of having to loop through RPC calls. |
Summary
The original idea was to minimize websocket events we are sending out since most of them are broadcast to the entire channel even though it's likely that only a subset of members are in the call and plenty of these events are unneeded by clients not connected to the call (e.g. mute/unmute and other session state changes).
However, to optimize this we need to have the list of participants which in certain cases means an additional call to the database to fetch the call state. Also
model.WebsocketBroadcast
doesn't support a slice of user ids so we need to loop onPublishWebSocketEvent
from the plugin side.Even though the reasoning behind this PR makes total sense from a logical perspective (avoid sending out unnecessary data), the above practical reasons make me doubt a little on whether the changes are actually worth the tradeoffs from a performance standpoint. Will need to load-test a bit and how this behaves at scale.
Ticket Link
https://mattermost.atlassian.net/browse/MM-53455