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

Improve how active calls work #3029

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Jun 13, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

  • Sending the m.call.notify event is now done in CallScreenPresenter once we know the sync is running.
  • You can mark a call of both external url or room type as joined.
  • Hanging up checks the current active call type and will only remove it if it matches.

Motivation and context

@toger5 mentioned some ways in which the EXA implementation of ringing calls could be improved.

Tests

  • Just tests calling between clients in several scenarios.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14.

Checklist

- Sending the `m.call.notify` event is now done in `CallScreenPresenter` once we know the sync is running.
- You can mark a call of both external url or room type as joined.
- Hanging up checks the current active call type and will only remove it if it matches.
@jmartinesp jmartinesp requested a review from a team as a code owner June 13, 2024 14:36
@jmartinesp jmartinesp requested review from bmarty and removed request for a team June 13, 2024 14:36
@jmartinesp jmartinesp requested a review from toger5 June 13, 2024 14:37
Copy link
Contributor

github-actions bot commented Jun 13, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/JVHNQD

@jmartinesp jmartinesp force-pushed the misc/jme/improve-how-active-calls-work branch from f62fced to e18c8d0 Compare June 13, 2024 15:00
Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 78.12500% with 7 lines in your changes missing coverage. Please review.

Project coverage is 75.80%. Comparing base (2b5ea96) to head (2ff3ee9).

Files Patch % Lines
...all/impl/receivers/DeclineCallBroadcastReceiver.kt 0.00% 2 Missing ⚠️
...droid/features/call/impl/ui/CallScreenPresenter.kt 71.42% 0 Missing and 2 partials ⚠️
...roid/features/call/impl/ui/IncomingCallActivity.kt 0.00% 2 Missing ⚠️
...roid/features/call/impl/utils/ActiveCallManager.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3029      +/-   ##
===========================================
- Coverage    75.80%   75.80%   -0.01%     
===========================================
  Files         1623     1623              
  Lines        38230    38237       +7     
  Branches      7369     7372       +3     
===========================================
+ Hits         28982    28987       +5     
- Misses        5395     5397       +2     
  Partials      3853     3853              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmarty
Copy link
Member

bmarty commented Jun 18, 2024

I am currently testing the feature.

I think this commit e18c8d0 can be dropped, I have fixed the failing test in #3036

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes make sense, and my tests went well, thanks!

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jun 18, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jun 18, 2024
Comment on lines 62 to 65
* Hangs up the active call and removes any associated UI.
* @param callType The type of call that the user hung up, either an external url one or a room one.
*/
fun hungUpCall()
fun hungUpCall(callType: CallType)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there seems to be a conflict between the docstring and the method name.
hangUpCall or

 * Called when the active call has been hung up and all associated UI was removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*/
fun hungUpCall()
fun hungUpCall(callType: CallType)

/**
* Called when the user joins a call. It will remove any existing UI and set the call state as [CallState.InCall].
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Called when the user joins a call. It will remove any existing UI and set the call state as [CallState.InCall].
* Called after the user joined a call. It will remove any existing UI and set the call state as [CallState.InCall].

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmartinesp jmartinesp force-pushed the misc/jme/improve-how-active-calls-work branch from 6538113 to 2ff3ee9 Compare June 18, 2024 09:43
Copy link

sonarcloud bot commented Jun 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@jmartinesp
Copy link
Member Author

@toger5 let me know if any other changes are needed.

@toger5
Copy link

toger5 commented Jun 18, 2024

@bmarty the rest made sense from just skimming over it.

Is this related: element-hq/element-call#2421

@jmartinesp
Copy link
Member Author

Is this related: element-hq/element-call#2421

I don't think so. We don't really have some event we receive as a push that says 'this user hung up, the call is now over' we can use to cancel the ringing, right?

@jmartinesp
Copy link
Member Author

Maybe we could try using the room info and observe the call status from there as long as we have an active call now that I think about it. But I'd add that on a separate PR.

@toger5
Copy link

toger5 commented Jun 18, 2024

@jmartinesp yea that is how its intended to be done. When the ring starts, we want to run the sync loop and once we receive an empty call member event (room info updates to call has stopped) we update the state again.

Initially it was planned to do all this in the rust sdk directly but the app team decided this is quicker on the platform side.

@jmartinesp
Copy link
Member Author

Ok, then I'll merge this as is and then continue the work on another PR once I'm free from my current tasks.

@jmartinesp jmartinesp merged commit 2e32adf into develop Jun 18, 2024
24 checks passed
@jmartinesp jmartinesp deleted the misc/jme/improve-how-active-calls-work branch June 18, 2024 10:07
@toger5
Copy link

toger5 commented Jun 18, 2024

This sounds really good. Can you evaluate with @stefanceriu if there is a chance to move some of that logic into the rust sdk?

Maybe its also worth to confirm with the MSC: https://github.com/matrix-org/matrix-spec-proposals/blob/toger5/matrixrtc-call-ringing/proposals/4075-call-notify-event.md
if the mobile implementation covers all the cases. (That should mention all the cases in which we should start and stop to ring.)

@jmartinesp
Copy link
Member Author

PoC of a platform implementation for this: #3047

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants