-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
Add unit tests for hangup / reject #2606
Conversation
Except the tests actually don't seem to be passing :/ |
|
||
// make sure we're still going | ||
if (this.callHasEnded()) return; | ||
|
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.
I wonder if this should be in setState()
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.
I should go to sleep, anyway...
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.
Yeah, I did wonder about this and it seems quite elegant to basically just disallow state transitions out of 'ended', at the price of having to wrap all our setState calls in a try/catch (or some way to make the caller stop what it's doing).
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.
Yeah, so what I meant by I should go to sleep, anyway... is that there is no simple way to do this, so I think this is actually fine (same for the other comment)
// make sure the call hasn't ended before we continue | ||
if (this.callHasEnded()) return; | ||
|
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.
I wonder if this should be in sendAnswer()
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.
Possibly - I went for here as it's straight after it comes back from await-ing.
Fixes element-hq/element-call#537
Checklist
This change is marked as an internal change (Task), so will not be included in the changelog.