Skip to content

Commit 1a0ff3c

Browse files
authored
fix: remove main thread blocking from WebRTC peer connection setup
- Remove @mainactor from setLocalDescription and setRemoteDescription - Remove duplicate HasRemoteDescription event from setRemoteDescription - Fixes ~1s UI freeze when joining calls after app launch
1 parent 05690c0 commit 1a0ff3c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Sources/StreamVideo/WebRTC/v2/PeerConnection/StreamRTCPeerConnection.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ final class StreamRTCPeerConnection: StreamRTCPeerConnectionProtocol, @unchecked
7272
///
7373
/// - Parameter sessionDescription: The RTCSessionDescription to set as the local description.
7474
/// - Throws: An error if setting the local description fails.
75-
@MainActor
7675
func setLocalDescription(
7776
_ sessionDescription: RTCSessionDescription
7877
) async throws {
@@ -98,7 +97,6 @@ final class StreamRTCPeerConnection: StreamRTCPeerConnectionProtocol, @unchecked
9897
///
9998
/// - Parameter sessionDescription: The RTCSessionDescription to set as the remote description.
10099
/// - Throws: An error if setting the remote description fails.
101-
@MainActor
102100
func setRemoteDescription(
103101
_ sessionDescription: RTCSessionDescription
104102
) async throws {
@@ -114,7 +112,6 @@ final class StreamRTCPeerConnection: StreamRTCPeerConnectionProtocol, @unchecked
114112
if let error = error {
115113
continuation.resume(throwing: error)
116114
} else {
117-
self.subject.send(HasRemoteDescription(sessionDescription: sessionDescription))
118115
continuation.resume(returning: ())
119116
}
120117
}

0 commit comments

Comments
 (0)