aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-20 15:29:50 -0500
committerChristian Cleberg <[email protected]>2026-07-20 15:52:38 -0500
commitf834c8a8223c40bd17b90be8f6ab7db843d0914c (patch)
tree9e36e1122853d620aaae37a42b1f1d2aeda3b748
parentb4147fe8f14d900c5c87f5fc4129f79884bb92b1 (diff)
downloaddomain-dig-f834c8a8223c40bd17b90be8f6ab7db843d0914c.tar.gz
domain-dig-f834c8a8223c40bd17b90be8f6ab7db843d0914c.tar.bz2
domain-dig-f834c8a8223c40bd17b90be8f6ab7db843d0914c.zip
fix: StoreKit config path and Swift 6 concurrency warnings
The StoreKitConfigurationFileReference added in #11 used one '../' too many, resolving outside the repository. Xcode resolves it relative to the .xcodeproj's xcshareddata directory, so two levels reaches the repo root. SweepActivityAttributes is now explicitly nonisolated. The app target sets SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor while the widget target does not, so a type shared by both inferred a main-actor-isolated ActivityAttributes conformance that ActivityKit cannot use from its concurrent contexts. LocalAPIService's logger closures captured self strongly while their inner Tasks declared [weak self]. The weak capture is now on the outer closure and bound before the Task, so the concurrently-executing closure references an immutable strong local rather than the weak capture.
-rw-r--r--DomainDig.xcodeproj/xcshareddata/xcschemes/DomainDig.xcscheme2
-rw-r--r--LocalAPIService.swift14
-rw-r--r--Shared/SweepActivityAttributes.swift7
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