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

Fix sending call member events on leave #3799

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Oct 13, 2023

#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

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

Here's what your changelog entry will look like:

🐛 Bug Fixes

#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;
Copy link
Contributor

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)

Copy link
Member Author

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).

Copy link
Contributor

@toger5 toger5 left a 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) {

@dbkr
Copy link
Member Author

dbkr commented Oct 16, 2023

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).

@dbkr dbkr requested a review from toger5 October 16, 2023 10:46
@dbkr dbkr added this pull request to the merge queue Oct 17, 2023
Merged via the queue into develop with commit 4ce837b Oct 17, 2023
@dbkr dbkr deleted the dbkr/fix_send_leave_event branch October 17, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Member count doesn't decrease immediately
2 participants