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

refactor: Make CallingRepository a little more stateless #14553

Merged
merged 7 commits into from
Jan 26, 2023

Conversation

atomrc
Copy link
Contributor

@atomrc atomrc commented Jan 26, 2023

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

@@ -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);
Copy link
Contributor Author

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

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
Copy link

codecov bot commented Jan 26, 2023

Codecov Report

Merging #14553 (5710948) into dev (ec44e5f) will increase coverage by 0.08%.
The diff coverage is 50.00%.

@@            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     

@atomrc atomrc merged commit f07850b into dev Jan 26, 2023
@atomrc atomrc deleted the refactor/Callingrepo-state branch January 26, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants