Skip to content

Conversation

@laevandus
Copy link
Contributor

🔗 Issue Links

Resolves: IOS-1187

🎯 Goal

Add Identifiable conformances for solving warnings in StreamChatSwiftUI module

Extension declares a conformance of imported type 'ChatChannel' to imported protocol 'Identifiable'; this will not behave correctly if the owners of 'StreamChat' introduce this conformance in the future

📝 Summary

🛠 Implementation

🎨 Showcase

🧪 Manual Testing Notes

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@laevandus laevandus requested a review from a team as a code owner October 22, 2025 12:47
@laevandus laevandus changed the title Add Identifiable conformances to models [V5] Add Identifiable conformances to models Oct 22, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 22, 2025

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.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v5-identifiable

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 and usage tips.

@github-actions
Copy link

1 Message
📖 There seems to be app changes but CHANGELOG wasn't modified.
Please include an entry if the PR includes user-facing changes.
You can find it at CHANGELOG.md.

Generated by 🚫 Danger

@github-actions
Copy link

Public Interface

+ extension ThreadParticipant: Identifiable  
+ 
+   public var id: String



- public struct Poll: Equatable, Sendable  
+ public struct Poll: Equatable, Identifiable, Sendable  

- public struct ChatMessageReaction: Hashable, Sendable  
+ public struct ChatMessageReaction: Hashable, Identifiable, Sendable  
-   public let type: MessageReactionType
+   public let id: String
-   public let score: Int
+   public let type: MessageReactionType
-   public let createdAt: Date
+   public let score: Int
-   public let updatedAt: Date
+   public let createdAt: Date
-   public let author: ChatUser
+   public let updatedAt: Date
-   public let extraData: [String: RawJSON]
+   public let author: ChatUser
+   public let extraData: [String: RawJSON]

- public struct DraftMessage: Sendable  
+ public struct DraftMessage: Sendable, Identifiable  

- public struct PollOption: Hashable, Equatable, Sendable  
+ public struct PollOption: Hashable, Equatable, Identifiable, Sendable  

- public class ChatUser: @unchecked Sendable  
+ public class ChatUser: Identifiable, @unchecked Sendable  

- public struct ChatMessage: Sendable  
+ public struct ChatMessage: Identifiable, Sendable  

- public struct PollVote: Hashable, Equatable, Sendable  
+ public struct PollVote: Hashable, Equatable, Identifiable, Sendable  

- public struct Device: Codable, Equatable, Sendable  
+ public struct Device: Codable, Equatable, Identifiable, Sendable  

- @dynamicMemberLookup public struct ChatMessageAttachment  
+ @dynamicMemberLookup public struct ChatMessageAttachment: Identifiable  

- public struct UserInfo: Sendable  
+ public struct UserInfo: Identifiable, Sendable  

- public struct MessageReminder: Sendable  
+ public struct MessageReminder: Identifiable, Sendable  

- public struct ChatThread: Sendable  
+ public struct ChatThread: Identifiable, Sendable  
-   public let parentMessageId: MessageId
+   public var id: MessageId
-   public let parentMessage: ChatMessage
+   public let parentMessageId: MessageId
-   public let channel: ChatChannel
+   public let parentMessage: ChatMessage
-   public let createdBy: ChatUser
+   public let channel: ChatChannel
-   public let replyCount: Int
+   public let createdBy: ChatUser
-   public let participantCount: Int
+   public let replyCount: Int
-   public let activeParticipantCount: Int
+   public let participantCount: Int
-   public let threadParticipants: [ThreadParticipant]
+   public let activeParticipantCount: Int
-   public let lastMessageAt: Date?
+   public let threadParticipants: [ThreadParticipant]
-   public let createdAt: Date
+   public let lastMessageAt: Date?
-   public let updatedAt: Date?
+   public let createdAt: Date
-   public let title: String?
+   public let updatedAt: Date?
-   public let latestReplies: [ChatMessage]
+   public let title: String?
-   public let reads: [ThreadRead]
+   public let latestReplies: [ChatMessage]
-   public let extraData: [String: RawJSON]
+   public let reads: [ThreadRead]
+   public let extraData: [String: RawJSON]

@Stream-SDK-Bot
Copy link
Collaborator

SDK Size

title develop branch diff status
StreamChat 8.26 MB 8.38 MB +117 KB 🟢
StreamChatUI 4.89 MB 5.05 MB +161 KB 🟢

@Stream-SDK-Bot
Copy link
Collaborator

SDK Performance

target metric benchmark branch performance status
MessageList Hitches total duration 10 ms 10.01 ms -0.1% 🔽 🟡
Duration 2.6 s 2.55 s 1.92% 🔼 🟢
Hitch time ratio 4 ms per s 3.93 ms per s 1.75% 🔼 🟢
Frame rate 75 fps 77.86 fps 3.81% 🔼 🟢
Number of hitches 1 1.0 0.0% 🟰 🟢

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

public struct ChatMessageReaction: Hashable, Identifiable, Sendable {
/// The id of the reaction.
let id: String
public let id: String
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this enough to identify a reaction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Internally this is

static func createId(
        userId: String,
        messageId: MessageId,
        type: MessageReactionType
    ) -> String {
        [userId, messageId, type.rawValue].joined(separator: "/")
    }

Which should be enough I think. SwiftUI has it currently

extension ChatMessageReaction: Identifiable {
    public var id: String {
        "\(author.id)-\(type.rawValue)"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants