Build Information
Successful build of swift-api-client, reference 1.69.0 (8b5149
), with Swift 6.1 for Linux on 9 Aug 2025 14:53:22 UTC.
Swift 6 data race errors: 78
Build Command
bash -c docker run --pull=always --rm -v "checkouts-4606859-1":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:basic-6.1-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures 2>&1
Build Log
| |- note: add '@MainActor' to make static property 'literal' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
64 | }
65 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:90:20: warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
64 | }
65 |
66 | public enum NestedEncodingStrategy {
| `- note: consider making enum 'NestedEncodingStrategy' conform to the 'Sendable' protocol
67 |
68 | case data(encoder: (ParametersEncoderOptions) -> DataEncoder, type: ValueType)
:
88 | }
89 |
90 | public static let json: NestedEncodingStrategy = .json()
| |- warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'json' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
91 |
92 | public static let brackets: NestedEncodingStrategy = .flatten { path in
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:92:20: warning: static property 'brackets' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
64 | }
65 |
66 | public enum NestedEncodingStrategy {
| `- note: consider making enum 'NestedEncodingStrategy' conform to the 'Sendable' protocol
67 |
68 | case data(encoder: (ParametersEncoderOptions) -> DataEncoder, type: ValueType)
:
90 | public static let json: NestedEncodingStrategy = .json()
91 |
92 | public static let brackets: NestedEncodingStrategy = .flatten { path in
| |- warning: static property 'brackets' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'brackets' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
93 | var key = path[0].stringValue
94 | let chain = path.dropFirst().map(\.stringValue).joined(separator: "][")
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:101:20: warning: static property 'dots' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
64 | }
65 |
66 | public enum NestedEncodingStrategy {
| `- note: consider making enum 'NestedEncodingStrategy' conform to the 'Sendable' protocol
67 |
68 | case data(encoder: (ParametersEncoderOptions) -> DataEncoder, type: ValueType)
:
99 | }
100 |
101 | public static let dots: NestedEncodingStrategy = .flatten { path in
| |- warning: static property 'dots' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'dots' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
102 | var result = ""
103 | let point = String(ParametersValue.point)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:230:13: warning: let '_iso8601Formatter' is not concurrency-safe because non-'Sendable' type 'ISO8601DateFormatter' may have shared mutable state; this is an error in the Swift 6 language mode
228 |
229 | @available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
230 | private let _iso8601Formatter: ISO8601DateFormatter = {
| |- warning: let '_iso8601Formatter' is not concurrency-safe because non-'Sendable' type 'ISO8601DateFormatter' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make let '_iso8601Formatter' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
231 | let formatter = ISO8601DateFormatter()
232 | formatter.formatOptions = .withInternetDateTime
Foundation.ISO8601DateFormatter:1:12: note: class 'ISO8601DateFormatter' does not conform to the 'Sendable' protocol
1 | open class ISO8601DateFormatter : Formatter, NSSecureCoding {
| `- note: class 'ISO8601DateFormatter' does not conform to the 'Sendable' protocol
2 | open var timeZone: TimeZone! { get set }
3 | open var formatOptions: ISO8601DateFormatter.Options { get set }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Types/TimeoutError.swift:100:17: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
98 | return try await withThrowingTaskGroup(of: T.self, returning: T.self) { group in
99 | group.addTask(operation: operation)
100 | group.addTask {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
101 | try await sleep(timeout)
| `- note: closure captures 'timeout' which is accessible to code in the current task
102 | throw TimeoutError(timeout: inSeconds, fileID: fileID, line: line)
103 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Types/TimeoutError.swift:105:10: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
81 | }
82 |
83 | func withTimeout<T, D>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
84 | _ timeout: D?,
85 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
103 | }
104 | defer {
105 | group.cancelAll()
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
106 | }
107 | guard let result = try await group.next() else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Types/TimeoutError.swift:98:19: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
81 | }
82 |
83 | func withTimeout<T, D>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
84 | _ timeout: D?,
85 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
96 | throw TimeoutError(timeout: 0, fileID: fileID, line: line)
97 | }
98 | return try await withThrowingTaskGroup(of: T.self, returning: T.self) { group in
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
99 | group.addTask(operation: operation)
100 | group.addTask {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Types/TimeoutError.swift:99:9: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
81 | }
82 |
83 | func withTimeout<T, D>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
84 | _ timeout: D?,
85 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
97 | }
98 | return try await withThrowingTaskGroup(of: T.self, returning: T.self) { group in
99 | group.addTask(operation: operation)
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
100 | group.addTask {
101 | try await sleep(timeout)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Types/TimeoutError.swift:100:9: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
81 | }
82 |
83 | func withTimeout<T, D>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
84 | _ timeout: D?,
85 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
98 | return try await withThrowingTaskGroup(of: T.self, returning: T.self) { group in
99 | group.addTask(operation: operation)
100 | group.addTask {
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
101 | try await sleep(timeout)
102 | throw TimeoutError(timeout: inSeconds, fileID: fileID, line: line)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Types/TimeoutError.swift:107:38: warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
81 | }
82 |
83 | func withTimeout<T, D>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
84 | _ timeout: D?,
85 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
105 | group.cancelAll()
106 | }
107 | guard let result = try await group.next() else {
| `- warning: type 'T' does not conform to the 'Sendable' protocol; this is an error in the Swift 6 language mode
108 | throw ImpossibleError()
109 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/AnyAsyncSequence.swift:21:15: warning: capture of 'box' with non-sendable type 'AnyAsyncSequence<Element>.Box<S.AsyncIterator>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
19 | let box = Box(sequence.makeAsyncIterator())
20 | return AsyncIterator {
21 | try await box.iterator.next()
| `- warning: capture of 'box' with non-sendable type 'AnyAsyncSequence<Element>.Box<S.AsyncIterator>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
22 | }
23 | }
:
43 | }
44 |
45 | private final class Box<I: AsyncIteratorProtocol> where I.Element == Element {
| `- note: generic class 'Box' does not conform to the 'Sendable' protocol
46 | var iterator: I
47 | init(_ iterator: I) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:27:20: warning: static property 'repeatKey' is not concurrency-safe because non-'Sendable' type 'ArrayEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public enum ArrayEncodingStrategy {
| `- note: consider making enum 'ArrayEncodingStrategy' conform to the 'Sendable' protocol
4 |
5 | case keyed((_ path: [CodingKey]) throws -> (path: [CodingKey], items: (Int) throws -> CodingKey))
:
25 |
26 | /// No brackets are appended. The key is encoded as is and repeated for each value.
27 | public static let repeatKey = ArrayEncodingStrategy.keyed { path in
| |- warning: static property 'repeatKey' is not concurrency-safe because non-'Sendable' type 'ArrayEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'repeatKey' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
28 | guard let key = path.last else {
29 | throw EncodingError.invalidValue(
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:62:20: warning: static property 'numeric' is not concurrency-safe because non-'Sendable' type 'BoolEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
52 | }
53 |
54 | public struct BoolEncodingStrategy {
| `- note: consider making struct 'BoolEncodingStrategy' conform to the 'Sendable' protocol
55 |
56 | public let encode: (Bool) -> String
:
60 | }
61 |
62 | public static let numeric: Self = .init { $0 ? "1" : "0" }
| |- warning: static property 'numeric' is not concurrency-safe because non-'Sendable' type 'BoolEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'numeric' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
63 | public static let literal: Self = .init(\.description)
64 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:63:20: warning: static property 'literal' is not concurrency-safe because non-'Sendable' type 'BoolEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
52 | }
53 |
54 | public struct BoolEncodingStrategy {
| `- note: consider making struct 'BoolEncodingStrategy' conform to the 'Sendable' protocol
55 |
56 | public let encode: (Bool) -> String
:
61 |
62 | public static let numeric: Self = .init { $0 ? "1" : "0" }
63 | public static let literal: Self = .init(\.description)
| |- warning: static property 'literal' is not concurrency-safe because non-'Sendable' type 'BoolEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'literal' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
64 | }
65 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:90:20: warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
64 | }
65 |
66 | public enum NestedEncodingStrategy {
| `- note: consider making enum 'NestedEncodingStrategy' conform to the 'Sendable' protocol
67 |
68 | case data(encoder: (ParametersEncoderOptions) -> DataEncoder, type: ValueType)
:
88 | }
89 |
90 | public static let json: NestedEncodingStrategy = .json()
| |- warning: static property 'json' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'json' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
91 |
92 | public static let brackets: NestedEncodingStrategy = .flatten { path in
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:92:20: warning: static property 'brackets' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
64 | }
65 |
66 | public enum NestedEncodingStrategy {
| `- note: consider making enum 'NestedEncodingStrategy' conform to the 'Sendable' protocol
67 |
68 | case data(encoder: (ParametersEncoderOptions) -> DataEncoder, type: ValueType)
:
90 | public static let json: NestedEncodingStrategy = .json()
91 |
92 | public static let brackets: NestedEncodingStrategy = .flatten { path in
| |- warning: static property 'brackets' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'brackets' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
93 | var key = path[0].stringValue
94 | let chain = path.dropFirst().map(\.stringValue).joined(separator: "][")
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:101:20: warning: static property 'dots' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
64 | }
65 |
66 | public enum NestedEncodingStrategy {
| `- note: consider making enum 'NestedEncodingStrategy' conform to the 'Sendable' protocol
67 |
68 | case data(encoder: (ParametersEncoderOptions) -> DataEncoder, type: ValueType)
:
99 | }
100 |
101 | public static let dots: NestedEncodingStrategy = .flatten { path in
| |- warning: static property 'dots' is not concurrency-safe because non-'Sendable' type 'NestedEncodingStrategy' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make static property 'dots' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
102 | var result = ""
103 | let point = String(ParametersValue.point)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Utils/Coders/EncodingStrategies.swift:230:13: warning: let '_iso8601Formatter' is not concurrency-safe because non-'Sendable' type 'ISO8601DateFormatter' may have shared mutable state; this is an error in the Swift 6 language mode
228 |
229 | @available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
230 | private let _iso8601Formatter: ISO8601DateFormatter = {
| |- warning: let '_iso8601Formatter' is not concurrency-safe because non-'Sendable' type 'ISO8601DateFormatter' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: add '@MainActor' to make let '_iso8601Formatter' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
231 | let formatter = ISO8601DateFormatter()
232 | formatter.formatOptions = .withInternetDateTime
Foundation.ISO8601DateFormatter:1:12: note: class 'ISO8601DateFormatter' does not conform to the 'Sendable' protocol
1 | open class ISO8601DateFormatter : Formatter, NSSecureCoding {
| `- note: class 'ISO8601DateFormatter' does not conform to the 'Sendable' protocol
2 | open var timeZone: TimeZone! { get set }
3 | open var formatOptions: ISO8601DateFormatter.Options { get set }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Types/TimeoutError.swift:100:17: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
98 | return try await withThrowingTaskGroup(of: T.self, returning: T.self) { group in
99 | group.addTask(operation: operation)
100 | group.addTask {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
101 | try await sleep(timeout)
| `- note: closure captures 'timeout' which is accessible to code in the current task
102 | throw TimeoutError(timeout: inSeconds, fileID: fileID, line: line)
103 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:121:13: warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
42 | }
43 |
44 | public struct APIErrorContext: Equatable {
| `- note: consider making struct 'APIErrorContext' conform to the 'Sendable' protocol
45 |
46 | public var request: HTTPRequestComponents?
:
119 | public var error: Error
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
| `- warning: stored property 'context' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIErrorContext'; this is an error in the Swift 6 language mode
122 | public var includeBody: IncludeBodyPolicy
123 |
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ErrorHandler.swift:122:13: warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
120 | public var configs: APIClient.Configs
121 | public var context: APIErrorContext
122 | public var includeBody: IncludeBodyPolicy
| `- warning: stored property 'includeBody' of 'Sendable'-conforming struct 'APIClientError' has non-sendable type 'APIClientError.IncludeBodyPolicy'; this is an error in the Swift 6 language mode
123 |
124 | public init(error: Error, configs: APIClient.Configs, context: APIErrorContext, includeBody: IncludeBodyPolicy) {
:
158 | }
159 |
160 | public enum IncludeBodyPolicy {
| `- note: consider making enum 'IncludeBodyPolicy' conform to the 'Sendable' protocol
161 |
162 | case never
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
Swift.PartialKeyPath:1:14: note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
1 | public class PartialKeyPath<Root> : AnyKeyPath {
| `- note: generic class 'PartialKeyPath' does not conform to the 'Sendable' protocol
2 | deinit
3 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:38:14: warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
36 |
37 | public let underlying: Error
38 | private var values: [PartialKeyPath<Self>: Any] = [:]
| `- warning: stored property 'values' of 'Sendable'-conforming struct 'HTTPClientMiddlewareError' has non-sendable type '[PartialKeyPath<HTTPClientMiddlewareError> : Any]'; this is an error in the Swift 6 language mode
39 |
40 | public init(_ underlying: Error) {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/HTTPClientMiddleware.swift:102:33: warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
1 | import Foundation
2 |
3 | public protocol HTTPClientMiddleware {
| `- note: protocol 'HTTPClientMiddleware' does not conform to the 'Sendable' protocol
4 |
5 | //#if swift(>=6.0)
:
100 | var next = next
101 | for middleware in middlewares {
102 | next = { [next] in try await middleware.execute(request: $0, configs: $1, next: next) }
| `- warning: capture of 'middleware' with non-sendable type 'any HTTPClientMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
103 | }
104 | return try await next(request, configs)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/LoggingModifier.swift:187:13: warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
185 | public extension Set<HTTPField.Name> {
186 |
187 | static var defaultMaskedHeaders: Set<HTTPField.Name> = [
| |- warning: static property 'defaultMaskedHeaders' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'defaultMaskedHeaders' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'defaultMaskedHeaders' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
188 | .authorization,
189 | .authenticationInfo,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/RateLimitModifier.swift:64:46: warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
38 | }
39 |
40 | private struct RateLimitMiddleware<ID: Hashable>: HTTPClientMiddleware {
| `- note: consider making generic struct 'RateLimitMiddleware' conform to the 'Sendable' protocol
41 |
42 | let id: (HTTPRequestComponents) -> ID
:
62 | count += 1
63 | try await withThrowingSynchronizedAccess(id: id) {
64 | try await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
| `- warning: capture of 'self' with non-sendable type 'RateLimitMiddleware<ID>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
65 | }
66 | (res, status) = try await extractStatusCodeEvenFailed {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
62 | let id: (HTTPRequestComponents) -> ID
63 |
64 | func execute<T>(
| `- note: consider making generic parameter 'T' conform to the 'Sendable' protocol
65 | request: HTTPRequestComponents,
66 | configs: APIClient.Configs,
:
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| `- warning: non-sendable result type '(T, HTTPResponse)?' cannot be sent from actor-isolated context in call to instance method 'response(for:)'; this is an error in the Swift 6 language mode
75 | return response
76 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:143:31: warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
128 | private extension APIClient {
129 |
130 | func timeout<D>(
| `- note: consider making generic parameter 'D' conform to the 'Sendable' protocol
131 | _ timeout: D,
132 | seconds: @escaping @Sendable (D) -> TimeInterval,
:
141 | timeout: timeout,
142 | seconds: inSeconds,
143 | sleep: { try await sleep(timeout) },
| `- warning: capture of 'timeout' with non-sendable type 'D' in a '@Sendable' closure; this is an error in the Swift 6 language mode
144 | fileID: fileID,
145 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:166:20: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
164 | try await withTimeout(
165 | timeout,
166 | seconds: { _ in seconds },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
167 | sleep: { _ in try await sleep() },
168 | fileID: fileID,
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TimeoutModifiers.swift:167:28: warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
149 | }
150 |
151 | private struct TimeoutMiddleware<D>: HTTPClientMiddleware {
| `- note: consider making generic struct 'TimeoutMiddleware' conform to the 'Sendable' protocol
152 |
153 | let timeout: D
:
165 | timeout,
166 | seconds: { _ in seconds },
167 | sleep: { _ in try await sleep() },
| `- warning: capture of 'self' with non-sendable type 'TimeoutMiddleware<D>' in a '@Sendable' closure; this is an error in the Swift 6 language mode
168 | fileID: fileID,
169 | line: line
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:139:15: warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
137 | } else if let requestToken, let url = request.url {
138 | (accessToken, refreshToken, currentExpiryDate) = try await withThrowingSynchronizedAccess(id: url.host) {
139 | try await requestToken(configs)
| |- warning: capture of 'requestToken' with non-sendable type '(APIClient.Configs) async throws -> (String, String?, Date?)' in a '@Sendable' closure; this is an error in the Swift 6 language mode
| `- note: a function type must be marked '@Sendable' to conform to 'Sendable'
140 | }
141 | } else {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/TokenRefresher/TokenRefresher.swift:175:54: warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
98 | }
99 |
100 | public struct TokenRefresherMiddleware: HTTPClientMiddleware {
| `- note: consider making struct 'TokenRefresherMiddleware' conform to the 'Sendable' protocol
101 |
102 | private let tokenCacheService: SecureCacheService
:
173 | ) async throws -> (String, String?, Date?) {
174 | try await withThrowingSynchronizedAccess(id: accessToken) { [self] in
175 | let (token, refreshToken, expiryDate) = try await refresh(refreshToken, configs)
| `- warning: capture of 'self' with non-sendable type 'TokenRefresherMiddleware' in a '@Sendable' closure; this is an error in the Swift 6 language mode
176 | try await tokenCacheService.save(token, for: .accessToken)
177 | if let refreshToken {
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/URLSessionModifiers.swift:35:13: warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
33 | private extension URLSession {
34 |
35 | static var apiClient: URLSession = {
| |- warning: static property 'apiClient' is not concurrency-safe because it is nonisolated global shared mutable state; this is an error in the Swift 6 language mode
| |- note: convert 'apiClient' to a 'let' constant to make 'Sendable' shared state immutable
| |- note: add '@MainActor' to make static property 'apiClient' part of global actor 'MainActor'
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
36 | var configs = URLSessionConfiguration.default
37 | configs.headers = .default
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending 'value' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending 'value' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
82 | }
83 | return (value, httpResponse)
| `- note: access can happen concurrently
84 | }
85 | }
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:78:15: warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| |- warning: sending value of non-Sendable type 'AnyHashable' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'AnyHashable' to actor-isolated instance method 'setResponse(response:for:)' risks causing data races between actor-isolated and local nonisolated uses
79 | Task {
| `- note: access can happen concurrently
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:74:52: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
72 | }
73 | let requestID = id(request)
74 | if let response: (T, HTTPResponse) = await cache.response(for: requestID) {
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending value of non-Sendable type 'ID' to actor-isolated instance method 'response(for:)' risks causing data races between actor-isolated and local nonisolated uses
75 | return response
76 | }
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
| `- note: access can happen concurrently
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:79:8: warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
77 | let (value, httpResponse) = try await next(request, configs)
78 | await cache.setResponse(response: (value, httpResponse), for: requestID)
79 | Task {
| `- warning: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure; this is an error in the Swift 6 language mode
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| `- note: closure captures 'self' which is accessible to code in the current task
82 | }
83 | return (value, httpResponse)
/host/spi-builder-workspace/Sources/SwiftAPIClient/Modifiers/ThrottleModifier.swift:81:16: warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
79 | Task {
80 | try? await Task.sleep(nanoseconds: UInt64(interval * 1_000_000_000))
81 | await cache.removeResponse(for: requestID)
| |- warning: sending value of non-Sendable type 'ID' risks causing data races; this is an error in the Swift 6 language mode
| `- note: sending task-isolated value of non-Sendable type 'ID' to actor-isolated instance method 'removeResponse(for:)' risks causing races in between task-isolated and actor-isolated uses
82 | }
83 | return (value, httpResponse)
Build complete! (187.49s)
Build complete.
{
"dependencies" : [
{
"identity" : "swift-log",
"requirement" : {
"range" : [
{
"lower_bound" : "1.0.0",
"upper_bound" : "2.0.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/apple/swift-log.git"
},
{
"identity" : "swift-http-types",
"requirement" : {
"range" : [
{
"lower_bound" : "1.0.0",
"upper_bound" : "2.0.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/apple/swift-http-types.git"
},
{
"identity" : "swift-metrics",
"requirement" : {
"range" : [
{
"lower_bound" : "2.4.0",
"upper_bound" : "3.0.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/apple/swift-metrics.git"
},
{
"identity" : "swift-syntax",
"requirement" : {
"range" : [
{
"lower_bound" : "509.0.0",
"upper_bound" : "601.0.0-prerelease"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/swiftlang/swift-syntax"
}
],
"manifest_display_name" : "swift-api-client",
"name" : "swift-api-client",
"path" : "/host/spi-builder-workspace",
"platforms" : [
{
"name" : "macos",
"version" : "10.15"
},
{
"name" : "ios",
"version" : "13.0"
},
{
"name" : "watchos",
"version" : "5.0"
},
{
"name" : "tvos",
"version" : "13.0"
}
],
"products" : [
{
"name" : "SwiftAPIClient",
"targets" : [
"SwiftAPIClient"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "SwiftAPIClientMacros",
"targets" : [
"SwiftAPIClientMacros"
],
"type" : {
"macro" : null
}
}
],
"targets" : [
{
"c99name" : "SwiftAPIClientTests",
"module_type" : "SwiftTarget",
"name" : "SwiftAPIClientTests",
"path" : "Tests/SwiftAPIClientTests",
"sources" : [
"CURLTests.swift",
"EncodersTests/MultipartFormDataTests.swift",
"HTTPHeadersEncoderTests.swift",
"Modifiers/AuthModifierTests.swift",
"Modifiers/ErrorDecodingTests.swift",
"Modifiers/HTTPResponseValidatorTests.swift",
"Modifiers/LogLevelModifierTests.swift",
"Modifiers/LoggingAndListenerTests.swift",
"Modifiers/MockResponsesTests.swift",
"Modifiers/QueryParameterMiddlewareTests.swift",
"Modifiers/RequestCompressionTests.swift",
"Modifiers/RequestModifiersTests.swift",
"NetworkClientTests.swift",
"TestUtils/Client+Ext.swift",
"TestUtils/QueryParameterMiddleware.swift",
"TestUtils/TestHTTPClient.swift",
"URLQueryEncoderTests.swift",
"UtilsTests/URLComponentBuilderTests.swift",
"UtilsTests/WithTimeoutTests.swift"
],
"target_dependencies" : [
"SwiftAPIClient"
],
"type" : "test"
},
{
"c99name" : "SwiftAPIClientMacrosTests",
"module_type" : "SwiftTarget",
"name" : "SwiftAPIClientMacrosTests",
"path" : "Tests/SwiftAPIClientMacrosTests",
"product_dependencies" : [
"SwiftSyntaxMacrosTestSupport"
],
"sources" : [
"APIMacroTests.swift",
"CallMacroTests.swift",
"PathMacroTests.swift"
],
"target_dependencies" : [
"SwiftAPIClientMacros"
],
"type" : "test"
},
{
"c99name" : "SwiftAPIClientMacros",
"module_type" : "SwiftTarget",
"name" : "SwiftAPIClientMacros",
"path" : "Sources/SwiftAPIClientMacros",
"product_dependencies" : [
"SwiftSyntaxMacros",
"SwiftCompilerPlugin"
],
"product_memberships" : [
"SwiftAPIClient",
"SwiftAPIClientMacros"
],
"sources" : [
"Collection++.swift",
"MacroError.swift",
"String++.swift",
"SwiftAPIClientMacros.swift"
],
"type" : "macro"
},
{
"c99name" : "SwiftAPIClient",
"module_type" : "SwiftTarget",
"name" : "SwiftAPIClient",
"path" : "Sources/SwiftAPIClient",
"product_dependencies" : [
"Logging",
"HTTPTypes",
"HTTPTypesFoundation",
"Metrics"
],
"product_memberships" : [
"SwiftAPIClient"
],
"sources" : [
"APIClient.swift",
"APIClientCaller.swift",
"APIClientConfigs.swift",
"APIClientType.swift",
"Clients/HTTPClient.swift",
"Clients/HTTPDownloadClient.swift",
"Clients/HTTPPublisher.swift",
"Clients/HTTPUploadClient.swift",
"Clients/URLSession+Client.swift",
"Extensions/Async++.swift",
"Extensions/String++.swift",
"Extensions/URLComponentBuilder.swift",
"Extensions/URLResponse++.swift",
"Imports.swift",
"Macros.swift",
"Modifiers/AuthModifier.swift",
"Modifiers/BackgroundModifiers.swift",
"Modifiers/CodeLocation.swift",
"Modifiers/CodersModifiers.swift",
"Modifiers/ErrorDecodeModifiers.swift",
"Modifiers/ErrorHandler.swift",
"Modifiers/HTTPClientMiddleware.swift",
"Modifiers/HTTPResponseValidator.swift",
"Modifiers/ListenerModifiers.swift",
"Modifiers/LoggingModifier.swift",
"Modifiers/MetricsModifier.swift",
"Modifiers/MockResponses.swift",
"Modifiers/RateLimitModifier.swift",
"Modifiers/RedirectModifier.swift",
"Modifiers/RequestCompression.swift",
"Modifiers/RequestModifiers.swift",
"Modifiers/RequestValidator.swift",
"Modifiers/ResponseWrapModifires.swift",
"Modifiers/RetryModifier.swift",
"Modifiers/ThrottleModifier.swift",
"Modifiers/TimeoutModifiers.swift",
"Modifiers/TokenRefresher/TokenCacheService.swift",
"Modifiers/TokenRefresher/TokenRefresher.swift",
"Modifiers/URLSessionModifiers.swift",
"Modifiers/WaitForConnectionModifier.swift",
"RequestBuilder.swift",
"Types/AsyncValue.swift",
"Types/ContentSerializer.swift",
"Types/ContentType.swift",
"Types/Errors.swift",
"Types/HTTPFields.swift",
"Types/HTTPRequestComponents.swift",
"Types/LoggingComponent.swift",
"Types/Mockable.swift",
"Types/RedirectBehaviour.swift",
"Types/Serializer.swift",
"Types/TimeoutError.swift",
"Utils/AnyAsyncSequence.swift",
"Utils/AnyEncodable.swift",
"Utils/Coders/ContentEncoder.swift",
"Utils/Coders/DataDecoder.swift",
"Utils/Coders/EncodingStrategies.swift",
"Utils/Coders/ErrorDecoder.swift",
"Utils/Coders/FormURLEncoder.swift",
"Utils/Coders/HeadersEncoder.swift",
"Utils/Coders/JSONContentEncoders.swift",
"Utils/Coders/MultipartFormData/MultipartFormData.swift",
"Utils/Coders/MultipartFormData/MultipartFormDataEncoder.swift",
"Utils/Coders/ParametersEncoder.swift",
"Utils/Coders/ParametersValue.swift",
"Utils/Coders/QueryEncoder.swift",
"Utils/Coders/URLQuery/HTTPHeadersEncoder.swift",
"Utils/Coders/URLQuery/PlainCodingKey.swift",
"Utils/Coders/URLQuery/Ref.swift",
"Utils/Coders/URLQuery/URLQueryEncoder.swift",
"Utils/ConsoleStyle.swift",
"Utils/Error+String.swift",
"Utils/NoneLogger.swift",
"Utils/Publisher+Create.swift",
"Utils/Publishers+Task.swift",
"Utils/Reachability.swift",
"Utils/Status+Ext.swift",
"Utils/URLSessionDelegateWrapper.swift",
"Utils/UpdateMetrics.swift",
"Utils/WithSynchronizedAccess.swift"
],
"target_dependencies" : [
"SwiftAPIClientMacros"
],
"type" : "library"
}
],
"tools_version" : "5.9"
}
basic-6.1-latest: Pulling from finestructure/spi-images
Digest: sha256:2e2b3aca8600f890617c2faa770b70e33c1dfd303d6f92b308423b89ef6bde64
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:basic-6.1-latest
Done.