-
Notifications
You must be signed in to change notification settings - Fork 28
[Fix]CallSettings rapid updates #913
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9b20920
[Fix]Local audio waveform not always working
ipavlidakis 48ca060
Add comments
ipavlidakis 5bfa01f
Simplify naming
ipavlidakis 2821e00
Fix existing tests
ipavlidakis 53b6f96
Fix SwiftUI tests
ipavlidakis 2536175
Add tests
ipavlidakis e71f3ab
Update changelog
ipavlidakis 304f24c
Improve applicationState middleware tests
ipavlidakis d231c14
Add stress tests for Store
ipavlidakis 9d9bd06
Fix xcode 15 issues
ipavlidakis 6368d91
[Fix]CallSettings rapid updates
ipavlidakis 1fde348
[Fix]Local audio waveform not always working (#912)
ipavlidakis bb4ac08
[Fix]CallSettings rapid updates
ipavlidakis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,10 +119,6 @@ extension WebRTCCoordinator.StateMachine.Stage { | |
|
||
try Task.checkCancellation() | ||
|
||
await observeCallSettingsUpdates() | ||
|
||
try Task.checkCancellation() | ||
|
||
await observePeerConnectionState() | ||
|
||
try Task.checkCancellation() | ||
|
@@ -386,42 +382,6 @@ extension WebRTCCoordinator.StateMachine.Stage { | |
.store(in: disposableBag) | ||
} | ||
|
||
/// Observes updates to the `callSettings` and ensures that any changes are | ||
/// reflected in the publisher. This ensures that updates to audio, video, and | ||
/// audio output settings are applied correctly during a WebRTC session. | ||
private func observeCallSettingsUpdates() async { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I haven't seen a replacement for this? How do we listen to updates now? |
||
await context | ||
.coordinator? | ||
.stateAdapter | ||
.$callSettings | ||
.compactMap { $0 } | ||
.removeDuplicates() | ||
.sinkTask(storeIn: disposableBag) { [weak self] callSettings in | ||
guard let self else { return } | ||
do { | ||
guard | ||
let publisher = await context.coordinator?.stateAdapter.publisher | ||
else { | ||
log.warning( | ||
"PeerConnection hasn't been set up for publishing.", | ||
subsystems: .webRTC | ||
) | ||
return | ||
} | ||
|
||
try await publisher.didUpdateCallSettings(callSettings) | ||
log.debug("Publisher callSettings updated.", subsystems: .webRTC) | ||
} catch { | ||
log.warning( | ||
"Will disconnect because failed to update callSettings on Publisher.[Error:\(error)]", | ||
subsystems: .webRTC | ||
) | ||
transitionDisconnectOrError(error) | ||
} | ||
} | ||
.store(in: disposableBag) // Store the Combine subscription in the disposable bag. | ||
} | ||
|
||
/// Observes the connection state of both the publisher and subscriber peer | ||
/// connections. If a disconnection is detected, the method attempts to restart | ||
/// ICE (Interactive Connectivity Establishment) for both the publisher and | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why do we remove this?
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.
This method was here to forward CallSettings to the
publisher
PeerConnection. However, because it was relying on the Combine chain for updates, it was always a time-fracture behind.Now, we are removing this and moving the
publiher
peerconnection update directly on theWebRTCStateAdapter
next to when it updates its own CallSettings.