-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Fix sending call member events on leave #3799
Conversation
#3756 changed the membership update function to await on the next call, but this meant it never returned and therefore never cleared `updateCallMembershipRunning`. We therefore didn't send the updated call member event when leaving, instead sending it whenever the next poll interval arrived. This changes it to only await if we are retrying, not if we're just scheduling the next poll. Fixes element-hq/element-call#1763
} catch (e) { | ||
resendDelay = CALL_MEMBER_EVENT_RETRY_DELAY_MIN + Math.random() * 2000; | ||
const resendDelay = CALL_MEMBER_EVENT_RETRY_DELAY_MIN + Math.random() * 2000; |
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.
do declarations outlive the catch scope? (sorry this might be rust making me ancious)
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.
No, I think scopes are all the same in js (at least this one doesn't , I tested).
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.
The main issue is, that we checked for resendDelay before this.triggerCallMembershipEventUpdate();
?: if (resendDelay) {
Not quite sure what you mean, but the problem was that we were using resendDelay to decide whether to await on the next call or not, but resendDelay was set both in the case of failures and also when we just wanted to schedule the next update (badly named variable really). |
#3756 changed the membership update function to await on the next call, but this meant it never returned and therefore never cleared
updateCallMembershipRunning
. We therefore didn't send the updated call member event when leaving, instead sending it whenever the next poll interval arrived.This changes it to only await if we are retrying, not if we're just scheduling the next poll.
@toger5 review appreciated on this one - does this line up with what you expected your fix to do?
Fixes element-hq/element-call#1763
Checklist
Here's what your changelog entry will look like:
🐛 Bug Fixes