-
Notifications
You must be signed in to change notification settings - Fork 25
fix: commit pending proposals recovery strategy - WPB-23159 #4254
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: release/cycle-4.15
Are you sure you want to change the base?
Changes from all commits
e12aba5
cdf582b
af4b69d
c8cd6f6
1095945
6d7048d
6ee1c2a
0369bbd
5a0944b
93c2b24
004b32c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,7 @@ | |
| // MARK: - Public | ||
|
|
||
| public func qualifiedID(for conversation: ZMConversation) async -> QualifiedID? { | ||
| await context.perform { | ||
|
Check warning on line 60 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.qualifiedID | ||
| } | ||
| } | ||
|
|
@@ -66,7 +66,7 @@ | |
| _ lastReadMessage: LastRead, | ||
| in conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { [context] in | ||
|
Check warning on line 69 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| guard conversation.isSelfConversation else { | ||
| return | ||
| } | ||
|
|
@@ -82,7 +82,7 @@ | |
| _ clearedMessage: Cleared, | ||
| in conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { [context] in | ||
|
Check warning on line 85 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| guard conversation.isSelfConversation else { | ||
| return | ||
| } | ||
|
|
@@ -112,10 +112,11 @@ | |
| epoch: UInt64, | ||
| conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 115 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.mlsStatus = .ready | ||
| conversation.epoch = epoch | ||
| conversation.mlsGroupID = mlsGroupID | ||
| conversation.commitPendingProposalDate = nil | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -123,9 +124,10 @@ | |
| newMLSGroupID: MLSGroupID, | ||
| conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 127 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.mlsStatus = .pendingJoinAfterReset | ||
| conversation.mlsGroupID = newMLSGroupID | ||
| conversation.commitPendingProposalDate = nil | ||
| conversation.epoch = 0 | ||
| } | ||
| } | ||
|
|
@@ -147,7 +149,7 @@ | |
| public func fetchOtherUserIDInOneOnOneConversation( | ||
| conversation: ZMConversation | ||
| ) async -> WireDataModel.QualifiedID? { | ||
| await context.perform { | ||
|
Check warning on line 152 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| guard conversation.conversationType == .oneOnOne else { | ||
| WireLogger.conversation.info( | ||
| "conversation type is not expected 'oneOnOne', aborting." | ||
|
|
@@ -158,7 +160,7 @@ | |
|
|
||
| guard | ||
| let otherUser = conversation.localParticipantsExcludingSelf.first, | ||
| let otherUserID = otherUser.remoteIdentifier, | ||
|
Check warning on line 163 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| let otherUserDomain = otherUser.domain ?? self.localDomain | ||
| else { | ||
| WireLogger.conversation.warn( | ||
|
|
@@ -184,7 +186,7 @@ | |
| let mutedStatus = mutedStatusInfo.status | ||
| let mutedReference = mutedStatusInfo.referenceDate | ||
|
|
||
| if let mutedStatus, let mutedReference { | ||
|
Check warning on line 189 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| localConversation.updateMutedStatus( | ||
| status: Int32(mutedStatus), | ||
| referenceDate: mutedReference | ||
|
|
@@ -248,9 +250,9 @@ | |
|
|
||
| await context.perform { | ||
| // If user is already part of the conversation, its role will be updated. | ||
| // If not, user will be added to the conversation. | ||
|
Check warning on line 253 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.addParticipantAndUpdateConversationState( | ||
|
Check warning on line 254 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| user: user, | ||
|
Check warning on line 255 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| role: role | ||
| ) | ||
| } | ||
|
|
@@ -259,7 +261,7 @@ | |
| public func increaseUnreadCount( | ||
| for conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 264 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.internalEstimatedUnreadCount += 1 | ||
| } | ||
| } | ||
|
|
@@ -267,7 +269,7 @@ | |
| public func decreaseUnreadCount( | ||
| for conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 272 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.internalEstimatedUnreadCount -= 1 | ||
| } | ||
| } | ||
|
|
@@ -275,7 +277,7 @@ | |
| public func increaseUnreadSelfMentionCount( | ||
| for conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 280 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.internalEstimatedUnreadSelfMentionCount += 1 | ||
| } | ||
| } | ||
|
|
@@ -283,7 +285,7 @@ | |
| public func increaseUnreadSelfReplyCount( | ||
| for conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 288 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.internalEstimatedUnreadSelfReplyCount += 1 | ||
| } | ||
| } | ||
|
|
@@ -298,7 +300,7 @@ | |
| permission: Conversation.ChannelPermission, | ||
| conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 303 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.privateChannelPermission = PrivateChannelPermission(permission) | ||
| } | ||
| } | ||
|
|
@@ -313,7 +315,7 @@ | |
| domain: conversationDomain | ||
| ) | ||
|
|
||
| await context.perform { | ||
|
Check warning on line 318 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation?.channelHistoryDepth = historyDepth | ||
| } | ||
| } | ||
|
|
@@ -345,9 +347,9 @@ | |
| ] | ||
| ) | ||
| } | ||
|
|
||
|
Check warning on line 350 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| let usersAndRoles = await withTaskGroup(of: UserAndRole?.self) { taskGroup in | ||
| for newParticipant in participants { | ||
|
Check warning on line 352 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| taskGroup.addTask { [self] in | ||
| let user = await context.perform { [context] in | ||
| ZMUser.fetchOrCreate( | ||
|
|
@@ -371,7 +373,7 @@ | |
| } | ||
|
|
||
| var usersAndRoles: [UserAndRole?] = [] | ||
|
|
||
|
Check warning on line 376 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| for await userAndRole in taskGroup { | ||
| usersAndRoles.append(userAndRole) | ||
| } | ||
|
|
@@ -400,8 +402,8 @@ | |
| ) | ||
| } | ||
|
|
||
| await context.perform { | ||
|
Check warning on line 405 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| localConversation.addParticipantsAndUpdateConversationState( | ||
|
Check warning on line 406 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| usersAndRoles: usersAndRoles | ||
| ) | ||
| } | ||
|
|
@@ -411,7 +413,7 @@ | |
| user: ZMUser, | ||
| conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { [context] in | ||
|
Check warning on line 416 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| if user.objectID.isTemporaryID || conversation.objectID.isTemporaryID { | ||
| do { | ||
| try context.obtainPermanentIDs(for: [user, conversation]) | ||
|
|
@@ -429,7 +431,7 @@ | |
| to conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { [context] in | ||
| let systemMessage = ZMSystemMessage(nonce: UUID(), managedObjectContext: context) | ||
|
Check warning on line 434 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| systemMessage.systemMessageType = message.type | ||
| systemMessage.sender = message.sender | ||
| systemMessage.users = message.users ?? Set() | ||
|
|
@@ -448,7 +450,7 @@ | |
| systemMessage.relevantForConversationStatus = message.relevantForStatus | ||
| systemMessage.participantsRemovedReason = message.removedReason | ||
| systemMessage.domains = message.domains | ||
|
|
||
|
Check warning on line 453 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.append(systemMessage) | ||
| } | ||
| } | ||
|
|
@@ -546,7 +548,7 @@ | |
| domain: conversationDomain | ||
| ) | ||
|
|
||
| await context.perform { | ||
|
Check warning on line 551 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.isPendingMetadataRefresh = true | ||
| conversation.needsToBeUpdatedFromBackend = true | ||
| } | ||
|
|
@@ -587,7 +589,7 @@ | |
| public func conversationNeedsBackendUpdate( | ||
| _ conversation: ZMConversation | ||
| ) async -> Bool { | ||
| await context.perform { | ||
|
Check warning on line 592 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.needsToBeUpdatedFromBackend | ||
| } | ||
| } | ||
|
|
@@ -595,7 +597,7 @@ | |
| public func isConversationArchived( | ||
| _ conversation: ZMConversation | ||
| ) async -> Bool { | ||
| await context.perform { | ||
|
Check warning on line 600 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.isArchived | ||
| } | ||
| } | ||
|
|
@@ -603,7 +605,7 @@ | |
| public func isConversationForcedReadOnly( | ||
| _ conversation: ZMConversation | ||
| ) async -> Bool { | ||
| await context.perform { | ||
|
Check warning on line 608 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.isForcedReadOnly | ||
| } | ||
| } | ||
|
|
@@ -613,7 +615,7 @@ | |
| senderID: UUID?, | ||
| conversation: ZMConversation | ||
| ) async -> Bool { | ||
| await context.perform { | ||
|
Check warning on line 618 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.isMessageSilenced(message, senderID: senderID) | ||
| } | ||
| } | ||
|
|
@@ -636,7 +638,7 @@ | |
| ) async { | ||
| let scheduledDate = date + TimeInterval(commitDelay) | ||
|
|
||
| await context.perform { | ||
|
Check warning on line 641 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.commitPendingProposalDate = scheduledDate | ||
| } | ||
| } | ||
|
|
@@ -647,7 +649,7 @@ | |
| date: Date | ||
| ) async { | ||
| // Update the legal hold state in the conversation | ||
| await context.perform { | ||
|
Check warning on line 652 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.updateSecurityLevelIfNeededAfterReceiving( | ||
| message: genericMessage, | ||
| timestamp: date | ||
|
|
@@ -672,8 +674,8 @@ | |
| return | ||
| } | ||
|
|
||
| await context.perform { | ||
|
Check warning on line 677 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.addParticipantAndSystemMessageIfMissing( | ||
|
Check warning on line 678 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| participant, | ||
| date: date | ||
| ) | ||
|
|
@@ -683,7 +685,7 @@ | |
| public func conversationMutedMessageTypes( | ||
| _ conversation: ZMConversation | ||
| ) async -> MutedMessageTypes { | ||
| await context.perform { | ||
|
Check warning on line 688 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.mutedMessageTypes | ||
| } | ||
| } | ||
|
|
@@ -692,7 +694,7 @@ | |
| _ conversation: ZMConversation | ||
| ) async -> MutedMessageTypes { | ||
| await context.perform { [context] in | ||
| let selfUser = ZMUser.selfUser(in: context) | ||
|
Check warning on line 697 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| return selfUser.mutedMessagesTypes.union(conversation.mutedMessageTypes) | ||
| } | ||
| } | ||
|
|
@@ -700,7 +702,7 @@ | |
| public func lastReadServerTimestamp( | ||
| _ conversation: ZMConversation | ||
| ) async -> Date? { | ||
| await context.perform { | ||
|
Check warning on line 705 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.lastReadServerTimeStamp | ||
| } | ||
| } | ||
|
|
@@ -708,7 +710,7 @@ | |
| public func conversationMessageDestructionTimeout( | ||
| _ conversation: ZMConversation | ||
| ) async -> MessageDestructionTimeoutValue { | ||
| await context.perform { | ||
|
Check warning on line 713 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.activeMessageDestructionTimeoutValue ?? .init(rawValue: 0) | ||
| } | ||
| } | ||
|
|
@@ -717,7 +719,7 @@ | |
| timeoutValue: Double, | ||
| for conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 722 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.setMessageDestructionTimeoutValue( | ||
| .init(rawValue: timeoutValue), | ||
| for: .groupConversation | ||
|
|
@@ -729,7 +731,7 @@ | |
| hasReadReceiptsEnabled: Bool, | ||
| for conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 734 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.hasReadReceiptsEnabled = hasReadReceiptsEnabled | ||
| } | ||
| } | ||
|
|
@@ -737,7 +739,7 @@ | |
| public func messageProtocol( | ||
| for conversation: ZMConversation | ||
| ) async -> WireDataModel.MessageProtocol { | ||
| await context.perform { | ||
|
Check warning on line 742 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.messageProtocol | ||
| } | ||
| } | ||
|
|
@@ -745,13 +747,13 @@ | |
| public func isGroupConversation( | ||
| _ conversation: ZMConversation | ||
| ) async -> Bool { | ||
| await context.perform { | ||
|
Check warning on line 750 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.conversationType == .group | ||
| } | ||
| } | ||
|
|
||
| public func isSelfConversation(_ conversation: ZMConversation) async -> Bool { | ||
| await context.perform { | ||
|
Check warning on line 756 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.conversationType == .self | ||
| } | ||
| } | ||
|
|
@@ -759,7 +761,7 @@ | |
| public func name( | ||
| for conversation: ZMConversation | ||
| ) async -> String? { | ||
| await context.perform { | ||
|
Check warning on line 764 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.displayName | ||
| } | ||
| } | ||
|
|
@@ -779,7 +781,7 @@ | |
| } | ||
|
|
||
| let allGroupConversations = await context.perform { | ||
| // swiftformat:disable:next redundantProperty | ||
|
Check warning on line 784 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| let allGroupConversations: [ZMConversation] = user.participantRoles.compactMap { | ||
| guard $0.conversation?.conversationType == .group else { | ||
| return nil | ||
|
|
@@ -793,9 +795,9 @@ | |
|
|
||
| for conversation in allGroupConversations { | ||
| let (userTeam, isTeamMember, conversationTeam, conversationID, conversationDomain) = await context.perform { | ||
| ( | ||
|
Check warning on line 798 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| user.team, | ||
| user.isTeamMember, | ||
|
Check warning on line 800 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.team, | ||
| conversation.remoteIdentifier as UUID, | ||
| conversation.domain | ||
|
|
@@ -830,8 +832,8 @@ | |
| ) | ||
| } | ||
|
|
||
| await context.perform { | ||
|
Check warning on line 835 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.removeParticipantAndUpdateConversationState( | ||
|
Check warning on line 836 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| user: user, | ||
| initiatingUser: user | ||
| ) | ||
|
|
@@ -845,7 +847,7 @@ | |
| ) async -> Role { | ||
| await context.perform { [context] in | ||
| Role.fetchOrCreateRole( | ||
| with: role, | ||
|
Check warning on line 850 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| teamOrConversation: TeamOrConversation.matching(conversation), | ||
| in: context | ||
| ) | ||
|
|
@@ -857,7 +859,7 @@ | |
| accessModes: [String], | ||
| accessRoles: [String] | ||
| ) async { | ||
| await context.perform { [context] in | ||
|
Check warning on line 862 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.accessModeStrings = accessModes | ||
| conversation.accessRoleStringsV2 = accessRoles | ||
|
|
||
|
|
@@ -880,7 +882,7 @@ | |
| isDeletedRemotely: Bool, | ||
| conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 885 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.isDeletedRemotely = isDeletedRemotely | ||
| } | ||
| } | ||
|
|
@@ -890,9 +892,9 @@ | |
| users: Set<ZMUser>, | ||
| initiatingUser: ZMUser | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 895 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.removeParticipantsAndUpdateConversationState( | ||
|
Check warning on line 896 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| users: users, | ||
|
Check warning on line 897 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| initiatingUser: initiatingUser | ||
| ) | ||
| } | ||
|
|
@@ -901,7 +903,7 @@ | |
| public func localParticipants( | ||
| in conversation: ZMConversation | ||
| ) async -> Set<ZMUser> { | ||
| await context.perform { | ||
|
Check warning on line 906 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.localParticipants | ||
| } | ||
| } | ||
|
|
@@ -909,7 +911,7 @@ | |
| public func conversationName( | ||
| conversation: ZMConversation | ||
| ) async -> String? { | ||
| await context.perform { | ||
|
Check warning on line 914 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.userDefinedName | ||
| } | ||
| } | ||
|
|
@@ -918,7 +920,7 @@ | |
| newName: String, | ||
| conversation: ZMConversation | ||
| ) async { | ||
| await context.perform { | ||
|
Check warning on line 923 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.userDefinedName = newName | ||
| } | ||
| } | ||
|
|
@@ -958,10 +960,10 @@ | |
| domain: conversation.qualifiedID?.domain | ||
| ) | ||
|
|
||
| await context.perform { [self] in | ||
|
Check warning on line 963 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| localConversation.conversationType = .connection | ||
|
|
||
|
Check warning on line 965 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| commonUpdate( | ||
|
Check warning on line 966 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| from: conversation, | ||
| for: localConversation, | ||
| serverTimestamp: serverTimestamp, | ||
|
|
@@ -1015,15 +1017,15 @@ | |
| domain: conversation.qualifiedID?.domain | ||
| ) | ||
|
|
||
| let mlsGroupID = await context.perform { | ||
|
Check warning on line 1020 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| conversation.mlsGroupID | ||
| } | ||
|
|
||
| await context.perform { [self] in | ||
|
Check warning on line 1024 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| localConversation.conversationType = .`self` | ||
| localConversation.isPendingMetadataRefresh = false | ||
|
|
||
|
Check warning on line 1027 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| commonUpdate( | ||
|
Check warning on line 1028 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| from: conversation, | ||
| for: localConversation, | ||
| serverTimestamp: serverTimestamp, | ||
|
|
@@ -1072,13 +1074,13 @@ | |
| domain: conversation.qualifiedID?.domain | ||
| ) | ||
|
|
||
| await context.perform { [self] in | ||
|
Check warning on line 1077 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| isInitialFetch = localConversation.isPendingInitialFetch | ||
|
|
||
| localConversation.conversationType = .group | ||
| localConversation.remoteIdentifier = id | ||
| localConversation.isPendingMetadataRefresh = false | ||
| localConversation.isPendingInitialFetch = false | ||
|
Check warning on line 1083 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| localConversation.groupType = conversation.groupType.map { groupType in | ||
| switch groupType { | ||
| case .group: | ||
|
|
@@ -1101,7 +1103,7 @@ | |
| .disabled | ||
| } | ||
| } ?? .disabled | ||
|
|
||
|
Check warning on line 1106 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| commonUpdate( | ||
| from: conversation, | ||
| for: localConversation, | ||
|
|
@@ -1114,7 +1116,7 @@ | |
| from: conversation, | ||
| for: localConversation | ||
| ) | ||
|
|
||
|
Check warning on line 1119 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| if isInitialFetch { | ||
| assignMessageProtocol( | ||
| from: conversation, | ||
|
|
@@ -1149,9 +1151,9 @@ | |
| isMLSEnabled: isMLSEnabled | ||
| ) | ||
|
|
||
| await context.perform { [self] in | ||
|
Check warning on line 1154 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| if isInitialFetch { | ||
| // we just got a new conversation, we display new conversation header | ||
|
Check warning on line 1156 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| localConversation.appendNewConversationSystemMessage( | ||
| at: .distantPast, | ||
| users: localConversation.localParticipants | ||
|
|
@@ -1166,7 +1168,7 @@ | |
| } | ||
|
|
||
| // If we discover this group is actually a fake one on one, | ||
| // then we should link the one on one user. | ||
|
Check warning on line 1171 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| linkOneOnOneUserIfNeeded(for: localConversation) | ||
|
|
||
| // All metadata has been updated, object does not need to be updated from backend | ||
|
|
@@ -1201,14 +1203,14 @@ | |
| let conversationType = BackendConversationType.clientConversationType( | ||
| rawValue: conversationTypeRawValue | ||
| ) | ||
|
|
||
|
Check warning on line 1206 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| if localConversation.oneOnOneUser?.connection?.status == .sent { | ||
| localConversation.conversationType = .connection | ||
| } else { | ||
| localConversation.conversationType = conversationType | ||
| } | ||
|
|
||
|
Check warning on line 1212 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| assignMessageProtocol( | ||
|
Check warning on line 1213 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| from: conversation, | ||
| for: localConversation | ||
| ) | ||
|
|
@@ -1309,7 +1311,7 @@ | |
| domain: conversationDomain | ||
| ) | ||
|
|
||
| return await context.perform { | ||
|
Check warning on line 1314 in WireDomain/Sources/WireDomain/Repositories/Conversations/LocalStore/ConversationLocalStore.swift
|
||
| handler(conversation) | ||
| } | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.