diff --git a/Modules/Account/Package.swift b/Modules/Account/Package.swift index 87c12712c..40cbd8356 100644 --- a/Modules/Account/Package.swift +++ b/Modules/Account/Package.swift @@ -37,7 +37,12 @@ let package = Package( "Secrets", "SyncDatabase", ], - swiftSettings: [.swiftLanguageMode(.v5)]), + swiftSettings: [ + .enableUpcomingFeature("NonisolatedNonsendingByDefault"), + .enableUpcomingFeature("InferIsolatedConformances"), + .defaultIsolation(MainActor.self) + ] + ), .testTarget( name: "AccountTests", dependencies: ["Account"], diff --git a/Modules/Account/Sources/Account/CloudKit/CloudKitArticlesZone.swift b/Modules/Account/Sources/Account/CloudKit/CloudKitArticlesZone.swift index 0dc49510c..f3b3d449a 100644 --- a/Modules/Account/Sources/Account/CloudKit/CloudKitArticlesZone.swift +++ b/Modules/Account/Sources/Account/CloudKit/CloudKitArticlesZone.swift @@ -26,7 +26,7 @@ final class CloudKitArticlesZone: CloudKitZone { let compressionQueue = DispatchQueue(label: "Articles Zone Compression Queue") - struct CloudKitArticle { + nonisolated struct CloudKitArticle: Sendable { static let recordType = "Article" struct Fields { static let articleStatus = "articleStatus" @@ -47,7 +47,7 @@ final class CloudKitArticlesZone: CloudKitZone { } } - struct CloudKitArticleStatus { + nonisolated struct CloudKitArticleStatus: Sendable { static let recordType = "ArticleStatus" struct Fields { static let feedExternalID = "webFeedExternalID" @@ -223,7 +223,7 @@ private extension CloudKitArticlesZone { return record } - func compressArticleRecords(_ records: [CKRecord]) -> [CKRecord] { + nonisolated func compressArticleRecords(_ records: [CKRecord]) -> [CKRecord] { var result = [CKRecord]() for record in records { diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinEntry.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinEntry.swift index 72b5e5f7f..6b1b32c6a 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinEntry.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinEntry.swift @@ -10,8 +10,7 @@ import Foundation import RSParser import RSCore -final class FeedbinEntry: Decodable { - +nonisolated final class FeedbinEntry: Decodable, Sendable { let articleID: Int let feedID: Int let title: String? @@ -27,14 +26,12 @@ final class FeedbinEntry: Decodable { // requires a very specific date formatter to work and even then it fails occasionally. // Rather than loose all the entries we only lose the one date by decoding as a string // and letting the one date fail when parsed. - lazy var parsedDatePublished: Date? = { - if let datePublished = datePublished { + var parsedDatePublished: Date? { + if let datePublished { return RSDateWithString(datePublished) } - else { - return nil - } - }() + return nil + } enum CodingKeys: String, CodingKey { case articleID = "id" @@ -50,7 +47,7 @@ final class FeedbinEntry: Decodable { } } -struct FeedbinEntryJSONFeed: Decodable { +nonisolated struct FeedbinEntryJSONFeed: Decodable, Sendable { let jsonFeedAuthor: FeedbinEntryJSONFeedAuthor? let jsonFeedExternalURL: String? @@ -72,12 +69,12 @@ struct FeedbinEntryJSONFeed: Decodable { jsonFeedExternalURL = nil } } - } -struct FeedbinEntryJSONFeedAuthor: Decodable { +nonisolated struct FeedbinEntryJSONFeedAuthor: Decodable, Sendable { let url: String? let avatarURL: String? + enum CodingKeys: String, CodingKey { case url = "url" case avatarURL = "avatar" diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinImportResult.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinImportResult.swift index dea2b331f..705a2b405 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinImportResult.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinImportResult.swift @@ -8,8 +8,7 @@ import Foundation -struct FeedbinImportResult: Codable { - +nonisolated struct FeedbinImportResult: Codable, Sendable { let importResultID: Int let complete: Bool diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinStarredEntry.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinStarredEntry.swift index a8c4dbb38..3843b316d 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinStarredEntry.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinStarredEntry.swift @@ -8,12 +8,10 @@ import Foundation -struct FeedbinStarredEntry: Codable { - +nonisolated struct FeedbinStarredEntry: Codable, Sendable { let starredEntries: [Int] enum CodingKeys: String, CodingKey { case starredEntries = "starred_entries" } - } diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinSubscription.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinSubscription.swift index db93027b2..790ac9c62 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinSubscription.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinSubscription.swift @@ -10,8 +10,7 @@ import Foundation import RSCore import RSParser -struct FeedbinSubscription: Hashable, Codable { - +nonisolated struct FeedbinSubscription: Hashable, Codable, Sendable { let subscriptionID: Int let feedID: Int let name: String? @@ -35,10 +34,9 @@ struct FeedbinSubscription: Hashable, Codable { static func == (lhs: FeedbinSubscription, rhs: FeedbinSubscription) -> Bool { return lhs.subscriptionID == rhs.subscriptionID } - } -struct FeedbinSubscriptionJSONFeed: Codable { +nonisolated struct FeedbinSubscriptionJSONFeed: Codable, Sendable { let favicon: String? let icon: String? enum CodingKeys: String, CodingKey { @@ -47,22 +45,21 @@ struct FeedbinSubscriptionJSONFeed: Codable { } } -struct FeedbinCreateSubscription: Codable { +nonisolated struct FeedbinCreateSubscription: Codable, Sendable { let feedURL: String enum CodingKeys: String, CodingKey { case feedURL = "feed_url" } } -struct FeedbinUpdateSubscription: Codable { +nonisolated struct FeedbinUpdateSubscription: Codable, Sendable { let title: String enum CodingKeys: String, CodingKey { case title } } -struct FeedbinSubscriptionChoice: Codable { - +nonisolated struct FeedbinSubscriptionChoice: Codable, Sendable { let name: String? let url: String @@ -70,5 +67,4 @@ struct FeedbinSubscriptionChoice: Codable { case name = "title" case url = "feed_url" } - } diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinTag.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinTag.swift index 970b29f2d..3909768e6 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinTag.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinTag.swift @@ -8,8 +8,7 @@ import Foundation -struct FeedbinTag: Codable { - +nonisolated struct FeedbinTag: Codable, Sendable { let tagID: Int let name: String @@ -17,11 +16,9 @@ struct FeedbinTag: Codable { case tagID = "id" case name = "name" } - } -struct FeedbinRenameTag: Codable { - +nonisolated struct FeedbinRenameTag: Codable, Sendable { let oldName: String let newName: String @@ -29,15 +26,12 @@ struct FeedbinRenameTag: Codable { case oldName = "old_name" case newName = "new_name" } - } -struct FeedbinDeleteTag: Codable { - +nonisolated struct FeedbinDeleteTag: Codable, Sendable { let name: String enum CodingKeys: String, CodingKey { case name } - } diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinTagging.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinTagging.swift index b64103074..7c31af872 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinTagging.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinTagging.swift @@ -8,8 +8,7 @@ import Foundation -struct FeedbinTagging: Codable { - +nonisolated struct FeedbinTagging: Codable, Sendable { let taggingID: Int let feedID: Int let name: String @@ -19,11 +18,9 @@ struct FeedbinTagging: Codable { case feedID = "feed_id" case name = "name" } - } -struct FeedbinCreateTagging: Codable { - +nonisolated struct FeedbinCreateTagging: Codable, Sendable { let feedID: Int let name: String @@ -31,5 +28,4 @@ struct FeedbinCreateTagging: Codable { case feedID = "feed_id" case name = "name" } - } diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinUnreadEntry.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinUnreadEntry.swift index 1883c12a4..1bb59dbee 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinUnreadEntry.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinUnreadEntry.swift @@ -8,12 +8,10 @@ import Foundation -struct FeedbinUnreadEntry: Codable { - +nonisolated struct FeedbinUnreadEntry: Codable, Sendable { let unreadEntries: [Int] enum CodingKeys: String, CodingKey { case unreadEntries = "unread_entries" } - } diff --git a/Modules/Account/Sources/Account/Feedly/Feedly.swift b/Modules/Account/Sources/Account/Feedly/Feedly.swift index 9f6e7a585..fe6d27675 100644 --- a/Modules/Account/Sources/Account/Feedly/Feedly.swift +++ b/Modules/Account/Sources/Account/Feedly/Feedly.swift @@ -8,8 +8,7 @@ import Foundation import os.log -struct Feedly { - +nonisolated struct Feedly: Sendable { // Convention with this logger is to put "Feedly: " at the beginning of each message. static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "Feedly") } diff --git a/Modules/Account/Sources/Account/Feedly/OAuthAccountAuthorizationOperation.swift b/Modules/Account/Sources/Account/Feedly/OAuthAccountAuthorizationOperation.swift index 5d49d9eab..72130a30d 100644 --- a/Modules/Account/Sources/Account/Feedly/OAuthAccountAuthorizationOperation.swift +++ b/Modules/Account/Sources/Account/Feedly/OAuthAccountAuthorizationOperation.swift @@ -24,7 +24,7 @@ public enum OAuthAccountAuthorizationOperationError: LocalizedError { } @objc final class PresentationAnchorProvider: NSObject, ASWebAuthenticationPresentationContextProviding { - var presentationAnchor: ASPresentationAnchor? + nonisolated(unsafe) var presentationAnchor: ASPresentationAnchor? // MARK: - ASWebAuthenticationPresentationContextProviding @@ -36,7 +36,7 @@ public enum OAuthAccountAuthorizationOperationError: LocalizedError { } } -public final class OAuthAccountAuthorizationOperation: MainThreadOperation, @unchecked Sendable { +@MainActor public final class OAuthAccountAuthorizationOperation: MainThreadOperation, @unchecked Sendable { public var presentationAnchor: ASPresentationAnchor? { get { anchorProvider.presentationAnchor @@ -57,7 +57,7 @@ public final class OAuthAccountAuthorizationOperation: MainThreadOperation, @unc @MainActor public init(accountType: AccountType) { self.accountType = accountType self.oauthClient = Account.oauthAuthorizationClient(for: accountType) - super.init() + super.init(name: "OAuthAccountAuthorizationOperation") } @MainActor public override func run() { diff --git a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetCollectionsOperation.swift b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetCollectionsOperation.swift index 6a55b11a9..466267fa1 100644 --- a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetCollectionsOperation.swift +++ b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetCollectionsOperation.swift @@ -25,7 +25,7 @@ final class FeedlyGetCollectionsOperation: FeedlyOperation, FeedlyCollectionProv super.init() } - override func run() { + @MainActor override func run() { Feedly.logger.info("Feedly: Requesting collections") service.getCollections { result in diff --git a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift index 38d82e1d3..bdce212ee 100644 --- a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift +++ b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetEntriesOperation.swift @@ -54,7 +54,7 @@ final class FeedlyGetEntriesOperation: FeedlyOperation, FeedlyEntryProviding, Fe return name ?? String(describing: Self.self) } - override func run() { + @MainActor override func run() { service.getEntries(for: provider.entryIDs) { result in Task { @MainActor in switch result { diff --git a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift index 792f97793..6f2966cf8 100644 --- a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift +++ b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyGetStreamContentsOperation.swift @@ -96,7 +96,7 @@ final class FeedlyGetStreamContentsOperation: FeedlyOperation, FeedlyEntryProvid self.init(account: account, resource: resourceProvider.resource, service: service, newerThan: newerThan, unreadOnly: unreadOnly) } - override func run() { + @MainActor override func run() { service.getStreamContents(for: resourceProvider.resource, continuation: continuation, newerThan: newerThan, unreadOnly: unreadOnly) { result in Task { @MainActor in switch result { diff --git a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurFeed.swift b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurFeed.swift index f0b0300bb..007e71e7f 100644 --- a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurFeed.swift +++ b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurFeed.swift @@ -12,7 +12,7 @@ import RSParser typealias NewsBlurFolder = NewsBlurFeedsResponse.Folder -struct NewsBlurFeed: Hashable, Codable { +nonisolated struct NewsBlurFeed: Hashable, Codable, Sendable { let name: String let feedID: Int let feedURL: String @@ -20,21 +20,21 @@ struct NewsBlurFeed: Hashable, Codable { let faviconURL: String? } -struct NewsBlurFeedsResponse: Decodable { +nonisolated struct NewsBlurFeedsResponse: Decodable, Sendable { let feeds: [NewsBlurFeed] let folders: [Folder] - struct Folder: Hashable, Codable { + nonisolated struct Folder: Hashable, Codable, Sendable { let name: String let feedIDs: [Int] } } -struct NewsBlurAddURLResponse: Decodable { +nonisolated struct NewsBlurAddURLResponse: Decodable, Sendable { let feed: NewsBlurFeed? } -struct NewsBlurFolderRelationship { +nonisolated struct NewsBlurFolderRelationship: Sendable { let folderName: String let feedID: Int } @@ -49,7 +49,7 @@ extension NewsBlurFeed { } } -extension NewsBlurFeedsResponse { +nonisolated extension NewsBlurFeedsResponse { private enum CodingKeys: String, CodingKey { case feeds = "feeds" case folders = "flat_folders" diff --git a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurLoginResponse.swift b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurLoginResponse.swift index 9529ea8e0..c0ed69b3f 100644 --- a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurLoginResponse.swift +++ b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurLoginResponse.swift @@ -8,13 +8,13 @@ import Foundation -struct NewsBlurLoginResponse: Decodable { - var code: Int - var errors: LoginError? +nonisolated struct NewsBlurLoginResponse: Decodable, Sendable { + let code: Int + let errors: LoginError? - struct LoginError: Decodable { - var username: [String]? - var others: [String]? + nonisolated struct LoginError: Decodable, Sendable { + let username: [String]? + let others: [String]? } } diff --git a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStory.swift b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStory.swift index e4878b287..a31174a73 100644 --- a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStory.swift +++ b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStory.swift @@ -12,7 +12,7 @@ import RSParser typealias NewsBlurStory = NewsBlurStoriesResponse.Story -struct NewsBlurStoriesResponse: Decodable { +nonisolated struct NewsBlurStoriesResponse: Decodable, Sendable { let stories: [Story] struct Story: Decodable { diff --git a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStoryHash.swift b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStoryHash.swift index 48286df00..01780bb53 100644 --- a/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStoryHash.swift +++ b/Modules/Account/Sources/Account/NewsBlur/Models/NewsBlurStoryHash.swift @@ -12,19 +12,19 @@ import RSParser typealias NewsBlurStoryHash = NewsBlurStoryHashesResponse.StoryHash -struct NewsBlurStoryHashesResponse: Decodable { +nonisolated struct NewsBlurStoryHashesResponse: Decodable, Sendable { typealias StoryHashDictionary = [String: [StoryHash]] var unread: [StoryHash]? var starred: [StoryHash]? - struct StoryHash: Hashable, Codable { - var hash: String - var timestamp: Date + nonisolated struct StoryHash: Hashable, Codable, Sendable { + let hash: String + let timestamp: Date } } -extension NewsBlurStoryHashesResponse { +nonisolated extension NewsBlurStoryHashesResponse { private enum CodingKeys: String, CodingKey { case unread = "unread_feed_story_hashes" case starred = "starred_story_hashes" diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIEntry.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIEntry.swift index b6e3eb7a5..aac809393 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIEntry.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIEntry.swift @@ -10,12 +10,11 @@ import Foundation import RSParser import RSCore -struct ReaderAPIEntryWrapper: Codable { +nonisolated struct ReaderAPIEntryWrapper: Codable, Sendable { let id: String let updated: Int let entries: [ReaderAPIEntry] - enum CodingKeys: String, CodingKey { case id = "id" case updated = "updated" @@ -47,8 +46,7 @@ struct ReaderAPIEntryWrapper: Codable { } } */ -struct ReaderAPIEntry: Codable { - +nonisolated struct ReaderAPIEntry: Codable, Sendable { let articleID: String let title: String? let author: String? @@ -104,7 +102,7 @@ struct ReaderAPIEntry: Codable { } -struct ReaderAPIArticleSummary: Codable { +nonisolated struct ReaderAPIArticleSummary: Codable, Sendable { let content: String? enum CodingKeys: String, CodingKey { @@ -112,7 +110,7 @@ struct ReaderAPIArticleSummary: Codable { } } -struct ReaderAPIAlternateLocation: Codable { +nonisolated struct ReaderAPIAlternateLocation: Codable, Sendable { let url: String? enum CodingKeys: String, CodingKey { @@ -120,7 +118,7 @@ struct ReaderAPIAlternateLocation: Codable { } } -struct ReaderAPIEntryOrigin: Codable { +nonisolated struct ReaderAPIEntryOrigin: Codable, Sendable { let streamId: String? let title: String? diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPISubscription.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPISubscription.swift index bc388574a..d0ccee36c 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPISubscription.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPISubscription.swift @@ -19,7 +19,7 @@ import RSParser */ -struct ReaderAPIQuickAddResult: Codable { +nonisolated struct ReaderAPIQuickAddResult: Codable, Sendable { let numResults: Int let error: String? let streamId: String? @@ -31,7 +31,7 @@ struct ReaderAPIQuickAddResult: Codable { } } -struct ReaderAPISubscriptionContainer: Codable { +nonisolated struct ReaderAPISubscriptionContainer: Codable, Sendable { let subscriptions: [ReaderAPISubscription] enum CodingKeys: String, CodingKey { @@ -55,7 +55,7 @@ struct ReaderAPISubscriptionContainer: Codable { } */ -struct ReaderAPISubscription: Codable { +nonisolated struct ReaderAPISubscription: Codable, Sendable { let feedID: String let name: String? let categories: [ReaderAPICategory] @@ -81,7 +81,7 @@ struct ReaderAPISubscription: Codable { } } -struct ReaderAPICategory: Codable { +nonisolated struct ReaderAPICategory: Codable, Sendable { let categoryId: String let categoryLabel: String @@ -91,15 +91,14 @@ struct ReaderAPICategory: Codable { } } -struct ReaderAPICreateSubscription: Codable { +nonisolated struct ReaderAPICreateSubscription: Codable, Sendable { let feedURL: String enum CodingKeys: String, CodingKey { case feedURL = "feed_url" } } -struct ReaderAPISubscriptionChoice: Codable { - +nonisolated struct ReaderAPISubscriptionChoice: Codable, Sendable { let name: String? let url: String @@ -107,5 +106,4 @@ struct ReaderAPISubscriptionChoice: Codable { case name = "title" case url = "feed_url" } - } diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPITag.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPITag.swift index 345829a0e..219c99065 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPITag.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPITag.swift @@ -8,7 +8,7 @@ import Foundation -struct ReaderAPITagContainer: Codable { +nonisolated struct ReaderAPITagContainer: Codable, Sendable { let tags: [ReaderAPITag] enum CodingKeys: String, CodingKey { @@ -16,8 +16,7 @@ struct ReaderAPITagContainer: Codable { } } -struct ReaderAPITag: Codable { - +nonisolated struct ReaderAPITag: Codable, Sendable { let tagID: String let type: String? @@ -32,5 +31,4 @@ struct ReaderAPITag: Codable { } return String(tagID.suffix(from: range.upperBound)) } - } diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIUnreadEntry.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIUnreadEntry.swift index a80597adf..34c0b5be4 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIUnreadEntry.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIUnreadEntry.swift @@ -8,7 +8,7 @@ import Foundation -struct ReaderAPIReferenceWrapper: Codable { +nonisolated struct ReaderAPIReferenceWrapper: Codable, Sendable { let itemRefs: [ReaderAPIReference]? let continuation: String? @@ -18,7 +18,7 @@ struct ReaderAPIReferenceWrapper: Codable { } } -struct ReaderAPIReference: Codable { +nonisolated struct ReaderAPIReference: Codable, Sendable { let itemId: String? enum CodingKeys: String, CodingKey { diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIVariant.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIVariant.swift index 74c5a155e..42fd222ca 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIVariant.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIVariant.swift @@ -7,7 +7,7 @@ import Foundation -public enum ReaderAPIVariant { +nonisolated public enum ReaderAPIVariant: Sendable { case generic case freshRSS case inoreader @@ -26,5 +26,4 @@ public enum ReaderAPIVariant { return "" } } - } diff --git a/Modules/Account/Sources/Account/SidebarItem.swift b/Modules/Account/Sources/Account/SidebarItem.swift index 5ad176444..e7c7e4276 100644 --- a/Modules/Account/Sources/Account/SidebarItem.swift +++ b/Modules/Account/Sources/Account/SidebarItem.swift @@ -9,17 +9,15 @@ import Foundation import RSCore -public enum ReadFilterType { +nonisolated public enum ReadFilterType: Sendable { case read case none case alwaysRead } public protocol SidebarItem: SidebarItemIdentifiable, ArticleFetcher, DisplayNameProvider, UnreadCountProvider { - - var account: Account? { get } - var defaultReadFilterType: ReadFilterType { get } - + @MainActor var account: Account? { get } + @MainActor var defaultReadFilterType: ReadFilterType { get } } @MainActor public extension SidebarItem { @@ -35,5 +33,4 @@ public protocol SidebarItem: SidebarItemIdentifiable, ArticleFetcher, DisplayNam } } - } diff --git a/Modules/RSWeb/Sources/RSWeb/WebServices/Transport.swift b/Modules/RSWeb/Sources/RSWeb/WebServices/Transport.swift index 26d9971a2..5ba2b9633 100644 --- a/Modules/RSWeb/Sources/RSWeb/WebServices/Transport.swift +++ b/Modules/RSWeb/Sources/RSWeb/WebServices/Transport.swift @@ -114,7 +114,7 @@ nonisolated public enum TransportError: LocalizedError, Sendable { } -nonisolated public protocol Transport { +nonisolated public protocol Transport: Sendable { /// Cancels all pending requests func cancelAll()