diff options
| -rw-r--r-- | DomainDig.xcodeproj/xcshareddata/xcschemes/DomainDig.xcscheme | 2 | ||||
| -rw-r--r-- | LocalAPIService.swift | 14 | ||||
| -rw-r--r-- | Shared/SweepActivityAttributes.swift | 7 |
3 files changed, 14 insertions, 9 deletions
diff --git a/DomainDig.xcodeproj/xcshareddata/xcschemes/DomainDig.xcscheme b/DomainDig.xcodeproj/xcshareddata/xcschemes/DomainDig.xcscheme index c51d109..c6b73a4 100644 --- a/DomainDig.xcodeproj/xcshareddata/xcschemes/DomainDig.xcscheme +++ b/DomainDig.xcodeproj/xcshareddata/xcschemes/DomainDig.xcscheme @@ -58,7 +58,7 @@ </CommandLineArgument> </CommandLineArguments> <StoreKitConfigurationFileReference - identifier = "../../../DomainDig.storekit"> + identifier = "../../DomainDig.storekit"> </StoreKitConfigurationFileReference> </LaunchAction> <ProfileAction diff --git a/LocalAPIService.swift b/LocalAPIService.swift index ad1e07d..7d42128 100644 --- a/LocalAPIService.swift +++ b/LocalAPIService.swift @@ -182,14 +182,16 @@ final class LocalAPIService { let server = LocalAPIServer( port: Self.sanitizedPort(config.port), token: token, - requestLogger: { log in - Task { @MainActor [weak self] in - self?.record(log) + requestLogger: { [weak self] log in + guard let self else { return } + Task { @MainActor in + self.record(log) } }, - stateLogger: { stateMessage in - Task { @MainActor [weak self] in - self?.statusMessage = stateMessage + stateLogger: { [weak self] stateMessage in + guard let self else { return } + Task { @MainActor in + self.statusMessage = stateMessage } } ) diff --git a/Shared/SweepActivityAttributes.swift b/Shared/SweepActivityAttributes.swift index ee03c2d..81e7d02 100644 --- a/Shared/SweepActivityAttributes.swift +++ b/Shared/SweepActivityAttributes.swift @@ -4,8 +4,11 @@ import Foundation /// Live Activity contract for an in-flight watchlist sweep or batch lookup. /// /// Lives in `Shared/` because the app starts/updates the activity and the -/// widget extension renders it. -struct SweepActivityAttributes: ActivityAttributes { +/// widget extension renders it. Explicitly `nonisolated`: the app target sets +/// `SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor`, which would otherwise infer a +/// main-actor-isolated `ActivityAttributes` conformance that ActivityKit cannot +/// use from its concurrent contexts. +nonisolated struct SweepActivityAttributes: ActivityAttributes { struct ContentState: Codable, Hashable { var completed: Int var total: Int |
