Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/StreamVideo/Models/ClientCapability.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public enum ClientCapability: Hashable, Sendable, CaseIterable {
return nil
case .UNRECOGNIZED:
return nil
case .coordinatorStats:
return nil
Comment on lines +32 to +33
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Map .coordinatorStats instead of dropping it.

On Line 32, returning nil for a known capability silently discards it, so the SDK cannot represent or round-trip this value. Add a dedicated enum case and map it in both directions.

Proposed fix
 public enum ClientCapability: Hashable, Sendable, CaseIterable {
@@
     case subscriberVideoPause
+    case coordinatorStats
@@
     init?(_ source: Stream_Video_Sfu_Models_ClientCapability) {
         switch source {
         case .subscriberVideoPause:
             self = .subscriberVideoPause
+        case .coordinatorStats:
+            self = .coordinatorStats
         case .unspecified:
             return nil
         case .UNRECOGNIZED:
             return nil
-        case .coordinatorStats:
-            return nil
         }
     }
@@
     var rawValue: Stream_Video_Sfu_Models_ClientCapability {
         switch self {
         case .subscriberVideoPause:
             return .subscriberVideoPause
+        case .coordinatorStats:
+            return .coordinatorStats
         }
     }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Sources/StreamVideo/Models/ClientCapability.swift` around lines 32 - 33, Add
a dedicated enum case for the coordinatorStats capability in the
ClientCapability enum instead of returning nil; update the mapping logic that
translates between raw/string values and the enum (e.g., the init?(rawValue:) /
rawValue or fromRaw/toRaw switch branches where .coordinatorStats is currently
returning nil) so that the coordinatorStats raw string maps to the new
ClientCapability.coordinatorStats case and vice versa, ensuring the value is
preserved during encoding/decoding/round-trips.

}
}

Expand Down
Loading