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

Stop delaying ElementCall until the next sync loop and only notify other participants when presumed to already be up to date. #3559

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

stefanceriu
Copy link
Member

We implementing ringing we observed that sometimes notifications were being sent multiple times, causing multiple incoming calls to appear. The reason for that was that the app wasn't necessarily up to date and the call member list wes still unknown.

The fix was to delay the starting of the call until the next sync loop but that in turn made entering an ElementCall slow. We are now reverting that and only, intentionally, sending a notification if the user presses the button and a call is not running yet. We're assuming that the app is already up to date at that point and that the call state is correctly known.

Relates to element-hq/voip-internal/issues/259

…her participants when presumed to already be up to date.
@stefanceriu stefanceriu added the pr-bugfix for bug fix label Nov 26, 2024
@stefanceriu stefanceriu requested a review from a team as a code owner November 26, 2024 15:45
Copy link

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against 7c1cdaf

Copy link

sonarcloud bot commented Nov 26, 2024

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.

Project coverage is 78.53%. Comparing base (3698084) to head (7c1cdaf).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...urces/Screens/CallScreen/CallScreenViewModel.swift 0.00% 34 Missing ⚠️
.../FlowCoordinators/UserSessionFlowCoordinator.swift 0.00% 12 Missing ⚠️
ElementX/Sources/Application/AppCoordinator.swift 0.00% 1 Missing ⚠️
...ces/Screens/CallScreen/CallScreenCoordinator.swift 0.00% 1 Missing ⚠️
...X/Sources/Screens/CallScreen/View/CallScreen.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3559      +/-   ##
===========================================
- Coverage    78.58%   78.53%   -0.06%     
===========================================
  Files          757      757              
  Lines        63685    63683       -2     
===========================================
- Hits         50048    50013      -35     
- Misses       13637    13670      +33     
Flag Coverage Δ
unittests 69.64% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

Makes sense to me 📲

Comment on lines +582 to +583
// Here we assume that the app is running and the call state is already up to date
presentCallScreen(roomProxy: roomProxy, notifyOtherParticipants: !roomProxy.infoPublisher.value.hasRoomCall)
Copy link
Member

@pixlwave pixlwave Nov 26, 2024

Choose a reason for hiding this comment

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

FWIW, I think it would signal the intent more clearly if notifyOtherParticipants was passed up in the action, having its value derived from context.viewState.hasOngoingCall in the room screen. WDYT?

let colorScheme: ColorScheme = appMediator.windowManager.mainWindow.traitCollection.userInterfaceStyle == .light ? .light : .dark
presentCallScreen(configuration: .init(roomProxy: roomProxy,
clientProxy: userSession.clientProxy,
clientID: InfoPlistReader.main.bundleIdentifier,
elementCallBaseURL: appSettings.elementCallBaseURL,
elementCallBaseURLOverride: appSettings.elementCallBaseURLOverride,
colorScheme: colorScheme))
colorScheme: colorScheme),
notifyOtherParticipants: notifyOtherParticipants)
Copy link
Member

Choose a reason for hiding this comment

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

Should we add this to the configuration rather than passing it in separately?

@@ -132,52 +131,44 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol

// MARK: - Private

private func setupCall() {
private func setupCall(notifyOtherParticipants: Bool) {
Copy link
Member

Choose a reason for hiding this comment

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

Ok yeah answering my own question, I would say so given we access the configuration in this method.

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

Successfully merging this pull request may close these issues.

2 participants