-
Notifications
You must be signed in to change notification settings - Fork 225
[V5] Add Identifiable conformances to models #3852
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
base: v5
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
Generated by 🚫 Danger |
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] |
SDK Size
|
SDK Performance
|
|
| public struct ChatMessageReaction: Hashable, Identifiable, Sendable { | ||
| /// The id of the reaction. | ||
| let id: String | ||
| public let id: String |
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.
Is this enough to identify a reaction?
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.
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)"
}
}



🔗 Issue Links
Resolves: IOS-1187
🎯 Goal
Add Identifiable conformances for solving warnings in StreamChatSwiftUI module
📝 Summary
🛠 Implementation
🎨 Showcase
🧪 Manual Testing Notes
☑️ Contributor Checklist
docs-contentrepo