-
Notifications
You must be signed in to change notification settings - Fork 289
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
refactor: Make CallingRepository a little more stateless #14553
Conversation
@@ -692,7 +692,6 @@ export class CallingRepository { | |||
const convId = this.serializeQualifiedId(conversationId); | |||
this.logger.log(`Starting a call of type "${callType}" in conversation ID "${convId}"...`); | |||
try { | |||
await this.checkConcurrentJoinedCall(conversationId, CALL_STATE.OUTGOING); |
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.
It's not the responsibility of the CallingRepo to check if there is a call ongoing. This has been moved to the view layer (see CallingViewModel
)
call.currentPage(newPage); | ||
if (!this.callState.isSpeakersViewActive()) { | ||
this.requestCurrentPageVideoStreams(); | ||
this.requestCurrentPageVideoStreams(call); |
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.
We now inject the call that is concerned with the paging change in order for the CallingRepo not to have to check the state
Codecov Report
@@ Coverage Diff @@
## dev #14553 +/- ##
==========================================
+ Coverage 42.24% 42.32% +0.08%
==========================================
Files 612 612
Lines 20919 20912 -7
Branches 4791 4791
==========================================
+ Hits 8837 8852 +15
+ Misses 10973 10945 -28
- Partials 1109 1115 +6 |
This will move the view-related logic from the calling repository to the view model (where it should have belonged in the first place).
This touches those 2 scenarios:
Answering a call that is ringing when a call is already ongoing in another conversation:
join-incoming.mov
Starting a call while another one is already ongoing:
start-new.mov