diff --git a/MailCore/Cache/MailboxManager/MailboxManager+Thread.swift b/MailCore/Cache/MailboxManager/MailboxManager+Thread.swift index 36be566e8..0979719d2 100644 --- a/MailCore/Cache/MailboxManager/MailboxManager+Thread.swift +++ b/MailCore/Cache/MailboxManager/MailboxManager+Thread.swift @@ -324,11 +324,10 @@ public extension MailboxManager { private func addMessages(shortUids: [String], folder: Folder) async throws { guard !shortUids.isEmpty && !Task.isCancelled else { return } - let uniqueUids: [String] = getUniqueUids(folder: folder, remoteUids: shortUids) let messageByUidsResult = try await apiFetcher.messagesByUids( mailboxUuid: mailbox.uuid, folderId: folder.remoteId, - messageUids: uniqueUids + messageUids: shortUids ) try? writeTransaction { writableRealm in @@ -520,18 +519,6 @@ public extension MailboxManager { } } - private func getUniqueUids(folder: Folder, remoteUids: [String]) -> [String] { - let localUids = Set(folder.threads.map { Constants.shortUid(from: $0.uid) }) - let remoteUidsSet = Set(remoteUids) - var uniqueUids: Set = Set() - if localUids.isEmpty { - uniqueUids = remoteUidsSet - } else { - uniqueUids = remoteUidsSet.subtracting(localUids) - } - return uniqueUids.toArray() - } - // MARK: - Other func saveSearchThreads(result: ThreadResult, searchFolder: Folder) async {