Skip to content

[StreamCore] Use core WebSocket state for SFU#1204

Merged
ipavlidakis merged 2 commits into
iliaspavlidakis/ios-1816-migrate-sdk-signaling-core-infra-onto-stream-core-swiftfrom
iliaspavlidakis/deduplicate-sfuconnectionstate
Jul 20, 2026
Merged

[StreamCore] Use core WebSocket state for SFU#1204
ipavlidakis merged 2 commits into
iliaspavlidakis/ios-1816-migrate-sdk-signaling-core-infra-onto-stream-core-swiftfrom
iliaspavlidakis/deduplicate-sfuconnectionstate

Conversation

@ipavlidakis

Copy link
Copy Markdown
Contributor

🎯 Goal

Remove the video-owned SFUConnectionState wrapper and use StreamCore.WebSocketConnectionState directly in the SFU/WebRTC path.

📝 Summary

  • Deleted SFUConnectionState.
  • Migrated SFUWebSocket, SFUAdapter, and WebRTC coordinator context to WebSocketConnectionState.
  • Removed production and test-only state mapping glue.
  • Updated affected tests for StreamCore's connected state and wrapped server errors.

🛠 Implementation

SFUWebSocket now publishes StreamCore's WebSocketConnectionState directly. SFUAdapter mirrors that state without conversion, and the joined-stage context stores WebSocketConnectionState.DisconnectionSource.

The SFU error handling now unwraps StreamCore client errors at the existing coordinator boundary instead of relying on the removed SFU-specific wrapper.

🎨 Showcase

N/A. Internal migration only.

@ipavlidakis ipavlidakis self-assigned this Jul 20, 2026
@ipavlidakis
ipavlidakis requested a review from a team as a code owner July 20, 2026 08:10
@ipavlidakis ipavlidakis added the enhancement New feature or request label Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44e21c74-4fd8-4cf9-b3ac-5f39a2123728

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch iliaspavlidakis/deduplicate-sfuconnectionstate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

SDK Size

title develop branch diff status
StreamVideo 10.56 MB 9.5 MB -1083 KB 🚀
StreamVideoSwiftUI 2.47 MB 2.47 MB 0 KB 🟢
StreamVideoUIKit 2.6 MB 2.6 MB +1 KB 🟢
StreamWebRTC 11.87 MB 11.87 MB 0 KB 🟢

@github-actions

Copy link
Copy Markdown

Public Interface

🚀 No changes affecting the public interface.

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

StreamVideo XCSize

Object Diff (bytes)
WebRTCStateAdapter.o -85232
ApplicationLifecycleVideoMuteAdapter.o -68471
CallKitAlwaysAvailabilityPolicy.o -50154
Protobuf+SelectiveEncodable.o -46010
SFUAdapter.o -44192
Show 184 more objects
Object Diff (bytes)
StreamVideo.o -37832
Errors.o -37229
CallKitService.o -33418
RTCPeerConnectionCoordinator.o -32905
WebSocketClient.o -32143
URLSessionWebSocketEngine.o -32056
ConnectionRecoveryHandler.o -31550
Logger.o -24953
Call.o -20916
StreamCallAudioRecorder.o -19504
CallSettings.o -18632
LocalVideoMediaAdapter.o -14789
ReflectiveStringConvertible.o -14567
SignalServerEvent.o -13526
RawJSON.o -13385
WebSocketPingController.o -11954
LocalScreenShareMediaAdapter.o -11379
ScreenShareCaptureHandler.o -11264
WebRTCCoordinator+Joined.o -10302
CallsController.o -9896
BaseLogDestination.o -9042
Publisher+Logger.o -8053
ICEAdapter.o -8016
WebRTCPermissionsAdapter.o -7812
SFUEventAdapter.o -7502
NoiseCancellationFilter.o -7242
AudioBufferRenderer.o -7184
CameraCaptureHandler.o -6972
RTCAudioStore+AudioDeviceModuleMiddleware.o -6862
HTTPClient.o -6804
LocalAudioMediaAdapter.o -6518
CallKitPushNotificationAdapter.o -6236
StreamJsonDecoder.o -5654
StreamVideoEnvironment.o -5601
CoordinatorWebSocket.o +5333
EventNotificationCenter.o -5265
StreamCallAudioRecorder+AVAudioRecorderMiddleware.o -5220
BackgroundTaskScheduler.o -5100
SFUWebSocket.o +4969
DisposableBag.o -4967
WebRTCStatsCollector.o -4876
BroadcastCaptureHandler.o -4860
WebRTCStatsReporter.o -4772
PeerConnectionFactory.o -4735
StreamVideoCapturer.o -4716
WebRTCAuthenticator.o +4676
LogDestination.o -4597
URLSessionTransport.o -4558
WebRTCCoordinator+Joining.o -4529
events.pb.o +4024
EventBatcher.o -4000
ProximityManager.o -3870
CallCache.o -3719
CameraFocusHandler.o -3508
RawJSON+StreamCore.o +3432
WebRTCTracesAdapter.o -3303
OutgoingRingingController.o -3254
PermissionsStore.o -3232
WebSocketJoinTelemetryReporter.o -2940
AudioEngineLevelNodeAdapter.o -2903
CameraInterruptionsHandler.o -2880
VideoCaptureSession.o -2712
ScreenShareSession.o -2696
BroadcastBufferReader.o -2670
ConnectionStatus.o -2579
CameraSystemPressureHandler.o -2520
WebRTCCoordinator+Connecting.o -2440
VideoEvent+ReflectiveStringConvertible.o +2432
Publisher+TaskSink.o -2396
WebRTCStatsAdapter.o -2313
Call+Error.o -2304
WebRTCCoordinator+Error.o -2216
Call+JoiningStage.o -2212
CallAudioSession.o -2197
LastParticipantAutoLeavePolicy.o -2194
OperationQueue+TaskOperations.o -2184
WebRTCCoordinator+FastReconnecting.o -2180
WebRTCCoordinator+Disconnected.o -2143
Event.o -2101
DefaultTimer.o -2084
StreamStateMachine.o -1960
JoinedStateTelemetryReporter.o -1940
ThermalStateObserver.o -1936
StreamAppStateAdapter.o -1902
CallController.o -1901
AudioFilter.o -1806
ClientEventDelivery.o -1712
WebRTCCoordinator+Migrated.o -1676
RTCRtpTransceiverInit+Convenience.o -1660
CallKitAdapter.o -1658
StreamCallAudioRecorder+Logger.o -1650
WebRTCCoordinator+Stage.o -1626
HTTPUtils.o -1568
StreamCore_-14BA7DE23376E301_PackageProduct +1540
WebRTCMigrationStatusObserver.o -1536
APIKey.o -1488
RejectionReasonProvider.o -1456
InternetConnection.o +1436
PermissionStore+PushNotificationsMiddleware.o -1420
Task+Timeout.o -1356
StreamVideoCaptureHandler.o -1276
SimulatorScreenCapturer.o -1236
AVAudioConverter+Convert.o -1224
WebRTCCoordinator+PeerConnectionPreparing.o -1200
StoreLogger.o -1196
WebSocketEngine.o -1194
Call+Stage.o -1172
CallState.o -1163
ConsoleLogDestination.o -1093
RTCAudioStore+AVAudioSessionReducer.o -1088
Call+LeavingStage.o -1071
AudioDeviceModule.o -1025
signal.pb.o +1012
Logger+WebRTC.o -991
PublishOptions.o -960
WebRTCCoordinator.o -888
MediaAdapter.o +860
PrefixLogFormatter.o -854
SwiftProtobuf.o +784
BroadcastBufferUploader.o -732
Task+DisposableBag.o -696
Moderation+VideoAdapter.o -678
WebSocketClientProviding.o -660
ICEConnectionStateAdapter.o +656
EventMiddleware.o -614
WSEventsMiddleware.o +608
CallParticipant.o -598
APIError+ReflectiveStringConvertible.o +592
SFUEvent+StreamCore.o +588
Call+JoinedStage.o -544
models.pb.o +504
APIError.o -498
CallStatsReport.o -464
AVAudioSessionRouteDescription+Convenience.o -435
CallKitReconnectionPolicy.o +423
BroadcastSampleHandler.o -416
GeofenceSettings.o +408
WebRTCCoordinator+Rejoining.o -404
Call+RejectingStage.o +376
signal.twirp.o +375
Foundation.tbd -372
Call+AcceptingStage.o -368
ClientCapability.o +368
WebRTCCoordinator+Leaving.o -308
WebRTCCoordinator+Blocked.o -304
WebRTCCoordinator+CleanUp.o -300
WebRTCCoordinator+Migrating.o -292
CoordinatorModels.o -284
RTCMediaStream+CustomStringConvertible.o -260
RTCTemporaryPeerConnection.o +256
ProximityMonitor.o +248
WebRTCEventDecoder.o +246
BatteryStore+ObservationMiddleware.o -208
StreamRTCPeerConnection.o -196
RTCAudioStore+StereoPlayoutEffect.o -196
JsonEventDecoder.o +181
SpeakerManager.o -180
StreamCoreLogging.o +172
RawJSON+Double.o -168
RTCAudioStore+InterruptionsEffect.o -164
ClosedCaptionsAdapter.o +164
APIHelper.o -112
SystemEnvironment+XStreamClient.o +112
BatteryStore+ObserverEffect.o +108
LogFormatter.o -105
Combine.tbd -104
WebRTCAudioSessionWatchdog.o -100
RTCAudioStore+Namespace.o -96
WebRTCEvents.o +92
BatteryStore.o -84
StreamDeviceOrientationAdapter.o -80
QueryCallParticipantsResponse.o +76
Logger+ThrowingExecution.o +76
AudioProcessingStore.o +66
DispatchQueueExecutor.o +64
TimerPublisher.o +62
AVAudioSessionObserver.o -58
RTCAudioStore+RouteChangeEffect.o +54
StreamCallAudioRecorder+ShouldRecordMiddleware.o +54
RTCIceCandidate+Convenience.o +52
Moderation+Manager.o +50
RepeatingTimer.o -48
RTCAudioStore.o +48
OrderedCapacityQueue.o +44

@Stream-SDK-Bot

Copy link
Copy Markdown
Collaborator

StreamVideoSwiftUI XCSize

Object Diff (bytes)
StreamPictureInPictureAdapter.o +340
StreamCore_-14BA7DE23376E301_PackageProduct +268
StreamVideo.tbd -248
PictureInPictureController.o +108
PictureInPictureVideoCallViewController.o +108
CallViewModel.o -88

@ipavlidakis
ipavlidakis merged commit 940e94e into iliaspavlidakis/ios-1816-migrate-sdk-signaling-core-infra-onto-stream-core-swift Jul 20, 2026
11 of 12 checks passed
@ipavlidakis
ipavlidakis deleted the iliaspavlidakis/deduplicate-sfuconnectionstate branch July 20, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants