Build Information
Failed to build FlagsmithClient, reference v3.12.0 (019550), with Swift 6.2 for Wasm on 19 Nov 2026 11:08:42 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-53886768-0":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:wasm-6.2-latest swift build --swift-sdk swift-6.2-RELEASE_wasm 2>&1Build Log
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | private var dataTask: URLSessionDataTask? {
31 | get {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:30:27: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
28 |
29 | private var _dataTask: URLSessionDataTask?
30 | private var dataTask: URLSessionDataTask? {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | get {
32 | propertiesSerialAccessQueue.sync { _dataTask }
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:72:37: error: cannot find 'DispatchQueue' in scope
70 |
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
74 | private let reconnectionDelay = ReconnectionDelay()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:72:97: error: cannot infer contextual base in reference to member 'default'
70 |
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
74 | private let reconnectionDelay = ReconnectionDelay()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:73:39: error: cannot find 'DispatchQueue' in scope
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
74 | private let reconnectionDelay = ReconnectionDelay()
75 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:73:100: error: cannot infer contextual base in reference to member 'default'
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
74 | private let reconnectionDelay = ReconnectionDelay()
75 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:105:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
103 | // MARK: URLSessionDelegate
104 |
105 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
106 | serialAccessQueue.sync {
107 | if let message = String(data: data, encoding: .utf8) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:105:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
103 | // MARK: URLSessionDelegate
104 |
105 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
106 | serialAccessQueue.sync {
107 | if let message = String(data: data, encoding: .utf8) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:114:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | }
113 |
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | serialAccessQueue.sync {
116 | if task != dataTask {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:114:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | }
113 |
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | serialAccessQueue.sync {
116 | if task != dataTask {
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[10/29] Compiling FlagsmithClient UnknownTypeValue.swift
[11/29] Compiling FlagsmithClient resource_bundle_accessor.swift
[12/29] Compiling FlagsmithClient Experiment.swift
[13/29] Compiling FlagsmithClient Feature.swift
[14/29] Compiling FlagsmithClient Flag.swift
[15/29] Compiling FlagsmithClient CachedURLResponse.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/CachedURLResponse.swift:13:1: error: non-nominal type 'CachedURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
11 | #endif
12 |
13 | extension CachedURLResponse {
| `- error: non-nominal type 'CachedURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
14 | func response(withExpirationDuration duration: Int) -> CachedURLResponse {
15 | var cachedResponse = self
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:62:25: error: cannot find 'DispatchQueue' in scope
60 |
61 | private let send: Send
62 | private let queue = DispatchQueue(label: "flagsmithEventsQueue", qos: .utility)
| `- error: cannot find 'DispatchQueue' in scope
63 |
64 | private var _enabled = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:62:76: error: cannot infer contextual base in reference to member 'utility'
60 |
61 | private let send: Send
62 | private let queue = DispatchQueue(label: "flagsmithEventsQueue", qos: .utility)
| `- error: cannot infer contextual base in reference to member 'utility'
63 |
64 | private var _enabled = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:99:29: error: cannot find type 'DispatchSourceTimer' in scope
97 | private var buffer: [Event] = []
98 | private var exposureKeys: Set<[String?]> = []
99 | private var timer: (any DispatchSourceTimer)?
| `- error: cannot find type 'DispatchSourceTimer' in scope
100 | /// Indicates if a batch is being sent, retries included.
101 | private var sending = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:173:25: error: cannot find 'DispatchQueue' in scope
171 | whenIdle {
172 | if let completion = completion {
173 | DispatchQueue.global().async(execute: completion)
| `- error: cannot find 'DispatchQueue' in scope
174 | }
175 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:201:21: error: cannot find 'DispatchQueue' in scope
199 | timer = nil
200 | if let completion = completion {
201 | DispatchQueue.global().async(execute: completion)
| `- error: cannot find 'DispatchQueue' in scope
202 | }
203 | runIdleHandlers()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:297:37: error: cannot call value of non-function type 'Date'
295 | // The completion runs on `queue`, so after this.
296 | request = (id, cancel)
297 | queue.asyncAfter(deadline: .now() + requestTimeout) { [weak self] in
| `- error: cannot call value of non-function type 'Date'
298 | guard let self = self, self.request?.id == id else { return }
299 | self.request?.cancel()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:321:41: error: cannot call value of non-function type 'Date'
319 | case .retryable where attempt < maxAttempts:
320 | let delay = jitter(retryDelay * pow(2, Double(attempt - 1)))
321 | queue.asyncAfter(deadline: .now() + delay) { [weak self] in
| `- error: cannot call value of non-function type 'Date'
322 | self?.upload(events, attempt: attempt + 1, generation: generation)
323 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:348:26: error: cannot find 'DispatchTimeInterval' in scope
346 | return
347 | }
348 | let period = DispatchTimeInterval.seconds(_flushPeriod)
| `- error: cannot find 'DispatchTimeInterval' in scope
349 | let timer = DispatchSource.makeTimerSource(queue: queue)
350 | timer.schedule(deadline: .now() + period, repeating: period)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:349:25: error: cannot find 'DispatchSource' in scope
347 | }
348 | let period = DispatchTimeInterval.seconds(_flushPeriod)
349 | let timer = DispatchSource.makeTimerSource(queue: queue)
| `- error: cannot find 'DispatchSource' in scope
350 | timer.schedule(deadline: .now() + period, repeating: period)
351 | timer.setEventHandler { [weak self] in
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[16/29] Compiling FlagsmithClient FlagsmithAnalytics.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/CachedURLResponse.swift:13:1: error: non-nominal type 'CachedURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
11 | #endif
12 |
13 | extension CachedURLResponse {
| `- error: non-nominal type 'CachedURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
14 | func response(withExpirationDuration duration: Int) -> CachedURLResponse {
15 | var cachedResponse = self
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:62:25: error: cannot find 'DispatchQueue' in scope
60 |
61 | private let send: Send
62 | private let queue = DispatchQueue(label: "flagsmithEventsQueue", qos: .utility)
| `- error: cannot find 'DispatchQueue' in scope
63 |
64 | private var _enabled = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:62:76: error: cannot infer contextual base in reference to member 'utility'
60 |
61 | private let send: Send
62 | private let queue = DispatchQueue(label: "flagsmithEventsQueue", qos: .utility)
| `- error: cannot infer contextual base in reference to member 'utility'
63 |
64 | private var _enabled = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:99:29: error: cannot find type 'DispatchSourceTimer' in scope
97 | private var buffer: [Event] = []
98 | private var exposureKeys: Set<[String?]> = []
99 | private var timer: (any DispatchSourceTimer)?
| `- error: cannot find type 'DispatchSourceTimer' in scope
100 | /// Indicates if a batch is being sent, retries included.
101 | private var sending = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:173:25: error: cannot find 'DispatchQueue' in scope
171 | whenIdle {
172 | if let completion = completion {
173 | DispatchQueue.global().async(execute: completion)
| `- error: cannot find 'DispatchQueue' in scope
174 | }
175 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:201:21: error: cannot find 'DispatchQueue' in scope
199 | timer = nil
200 | if let completion = completion {
201 | DispatchQueue.global().async(execute: completion)
| `- error: cannot find 'DispatchQueue' in scope
202 | }
203 | runIdleHandlers()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:297:37: error: cannot call value of non-function type 'Date'
295 | // The completion runs on `queue`, so after this.
296 | request = (id, cancel)
297 | queue.asyncAfter(deadline: .now() + requestTimeout) { [weak self] in
| `- error: cannot call value of non-function type 'Date'
298 | guard let self = self, self.request?.id == id else { return }
299 | self.request?.cancel()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:321:41: error: cannot call value of non-function type 'Date'
319 | case .retryable where attempt < maxAttempts:
320 | let delay = jitter(retryDelay * pow(2, Double(attempt - 1)))
321 | queue.asyncAfter(deadline: .now() + delay) { [weak self] in
| `- error: cannot call value of non-function type 'Date'
322 | self?.upload(events, attempt: attempt + 1, generation: generation)
323 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:348:26: error: cannot find 'DispatchTimeInterval' in scope
346 | return
347 | }
348 | let period = DispatchTimeInterval.seconds(_flushPeriod)
| `- error: cannot find 'DispatchTimeInterval' in scope
349 | let timer = DispatchSource.makeTimerSource(queue: queue)
350 | timer.schedule(deadline: .now() + period, repeating: period)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:349:25: error: cannot find 'DispatchSource' in scope
347 | }
348 | let period = DispatchTimeInterval.seconds(_flushPeriod)
349 | let timer = DispatchSource.makeTimerSource(queue: queue)
| `- error: cannot find 'DispatchSource' in scope
350 | timer.schedule(deadline: .now() + period, repeating: period)
351 | timer.setEventHandler { [weak self] in
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[17/29] Compiling FlagsmithClient FlagsmithEvents.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/CachedURLResponse.swift:13:1: error: non-nominal type 'CachedURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
11 | #endif
12 |
13 | extension CachedURLResponse {
| `- error: non-nominal type 'CachedURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
14 | func response(withExpirationDuration duration: Int) -> CachedURLResponse {
15 | var cachedResponse = self
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:62:25: error: cannot find 'DispatchQueue' in scope
60 |
61 | private let send: Send
62 | private let queue = DispatchQueue(label: "flagsmithEventsQueue", qos: .utility)
| `- error: cannot find 'DispatchQueue' in scope
63 |
64 | private var _enabled = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:62:76: error: cannot infer contextual base in reference to member 'utility'
60 |
61 | private let send: Send
62 | private let queue = DispatchQueue(label: "flagsmithEventsQueue", qos: .utility)
| `- error: cannot infer contextual base in reference to member 'utility'
63 |
64 | private var _enabled = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:99:29: error: cannot find type 'DispatchSourceTimer' in scope
97 | private var buffer: [Event] = []
98 | private var exposureKeys: Set<[String?]> = []
99 | private var timer: (any DispatchSourceTimer)?
| `- error: cannot find type 'DispatchSourceTimer' in scope
100 | /// Indicates if a batch is being sent, retries included.
101 | private var sending = false
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:173:25: error: cannot find 'DispatchQueue' in scope
171 | whenIdle {
172 | if let completion = completion {
173 | DispatchQueue.global().async(execute: completion)
| `- error: cannot find 'DispatchQueue' in scope
174 | }
175 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:201:21: error: cannot find 'DispatchQueue' in scope
199 | timer = nil
200 | if let completion = completion {
201 | DispatchQueue.global().async(execute: completion)
| `- error: cannot find 'DispatchQueue' in scope
202 | }
203 | runIdleHandlers()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:297:37: error: cannot call value of non-function type 'Date'
295 | // The completion runs on `queue`, so after this.
296 | request = (id, cancel)
297 | queue.asyncAfter(deadline: .now() + requestTimeout) { [weak self] in
| `- error: cannot call value of non-function type 'Date'
298 | guard let self = self, self.request?.id == id else { return }
299 | self.request?.cancel()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:321:41: error: cannot call value of non-function type 'Date'
319 | case .retryable where attempt < maxAttempts:
320 | let delay = jitter(retryDelay * pow(2, Double(attempt - 1)))
321 | queue.asyncAfter(deadline: .now() + delay) { [weak self] in
| `- error: cannot call value of non-function type 'Date'
322 | self?.upload(events, attempt: attempt + 1, generation: generation)
323 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:348:26: error: cannot find 'DispatchTimeInterval' in scope
346 | return
347 | }
348 | let period = DispatchTimeInterval.seconds(_flushPeriod)
| `- error: cannot find 'DispatchTimeInterval' in scope
349 | let timer = DispatchSource.makeTimerSource(queue: queue)
350 | timer.schedule(deadline: .now() + period, repeating: period)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/FlagsmithEvents.swift:349:25: error: cannot find 'DispatchSource' in scope
347 | }
348 | let period = DispatchTimeInterval.seconds(_flushPeriod)
349 | let timer = DispatchSource.makeTimerSource(queue: queue)
| `- error: cannot find 'DispatchSource' in scope
350 | timer.schedule(deadline: .now() + period, repeating: period)
351 | timer.setEventHandler { [weak self] in
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[18/29] Compiling FlagsmithClient Traits.swift
[19/29] Compiling FlagsmithClient TypedValue.swift
[20/29] Compiling FlagsmithClient ReconnectionDelay.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:93:72: error: cannot find type 'URLRequest' in scope
91 | func request(baseUrl: URL,
92 | apiKey: String,
93 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
94 | {
95 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:108:23: error: cannot find 'URLRequest' in scope
106 | }
107 |
108 | var request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
109 | request.httpMethod = method.rawValue
110 | if let body = try body(using: encoder) {
[21/29] Compiling FlagsmithClient Router.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:93:72: error: cannot find type 'URLRequest' in scope
91 | func request(baseUrl: URL,
92 | apiKey: String,
93 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
94 | {
95 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:108:23: error: cannot find 'URLRequest' in scope
106 | }
107 |
108 | var request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
109 | request.httpMethod = method.rawValue
110 | if let body = try body(using: encoder) {
[22/29] Compiling FlagsmithClient SSEManager.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:16:35: error: cannot find type 'URLSessionDataDelegate' in scope
14 | /// It manages the connection to the SSE endpoint, processes incoming events,
15 | /// and handles reconnection logic with a backoff strategy.
16 | final class SSEManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
17 | private var _session: URLSession!
18 | private var session: URLSession {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:17:27: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | /// and handles reconnection logic with a backoff strategy.
16 | final class SSEManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
17 | private var _session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 | private var session: URLSession {
19 | get {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:18:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
16 | final class SSEManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
17 | private var _session: URLSession!
18 | private var session: URLSession {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | get {
20 | propertiesSerialAccessQueue.sync { _session }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:29:28: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
27 | }
28 |
29 | private var _dataTask: URLSessionDataTask?
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | private var dataTask: URLSessionDataTask? {
31 | get {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:30:27: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
28 |
29 | private var _dataTask: URLSessionDataTask?
30 | private var dataTask: URLSessionDataTask? {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | get {
32 | propertiesSerialAccessQueue.sync { _dataTask }
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:72:37: error: cannot find 'DispatchQueue' in scope
70 |
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
74 | private let reconnectionDelay = ReconnectionDelay()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:72:97: error: cannot infer contextual base in reference to member 'default'
70 |
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
74 | private let reconnectionDelay = ReconnectionDelay()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:73:39: error: cannot find 'DispatchQueue' in scope
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
74 | private let reconnectionDelay = ReconnectionDelay()
75 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:73:100: error: cannot infer contextual base in reference to member 'default'
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
74 | private let reconnectionDelay = ReconnectionDelay()
75 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:105:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
103 | // MARK: URLSessionDelegate
104 |
105 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
106 | serialAccessQueue.sync {
107 | if let message = String(data: data, encoding: .utf8) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:105:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
103 | // MARK: URLSessionDelegate
104 |
105 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
106 | serialAccessQueue.sync {
107 | if let message = String(data: data, encoding: .utf8) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:114:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | }
113 |
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | serialAccessQueue.sync {
116 | if task != dataTask {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:114:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | }
113 |
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | serialAccessQueue.sync {
116 | if task != dataTask {
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:23:54: error: cannot infer contextual base in reference to member 'barrier'
21 | }
22 | set {
23 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
24 | _session = newValue
25 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:35:54: error: cannot infer contextual base in reference to member 'barrier'
33 | }
34 | set {
35 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
36 | _dataTask = newValue
37 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:78:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
76 | override init() {
77 | super.init()
78 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
79 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
80 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:79:91: error: cannot find 'OperationQueue' in scope
77 | super.init()
78 | let configuration = URLSessionConfiguration.default
79 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
80 | }
81 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:79:19: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
77 | super.init()
78 | let configuration = URLSessionConfiguration.default
79 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
80 | }
81 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:116:16: error: cannot convert value of type 'URLSessionTask' (aka 'AnyObject') to expected argument type 'any (~Copyable & ~Escapable).Type'
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
115 | serialAccessQueue.sync {
116 | if task != dataTask {
| `- error: cannot convert value of type 'URLSessionTask' (aka 'AnyObject') to expected argument type 'any (~Copyable & ~Escapable).Type'
117 | return
118 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:116:24: error: cannot convert value of type 'URLSessionDataTask?' (aka 'Optional<AnyObject>') to expected argument type '(any (~Copyable & ~Escapable).Type)?'
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
115 | serialAccessQueue.sync {
116 | if task != dataTask {
| |- error: cannot convert value of type 'URLSessionDataTask?' (aka 'Optional<AnyObject>') to expected argument type '(any (~Copyable & ~Escapable).Type)?'
| `- note: arguments to generic parameter 'Wrapped' ('URLSessionDataTask' (aka 'AnyObject') and 'any (~Copyable & ~Escapable).Type') are expected to be equal
117 | return
118 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:156:23: error: cannot find 'URLRequest' in scope
154 | }
155 |
156 | var request = URLRequest(url: completeEventSourceUrl)
| `- error: cannot find 'URLRequest' in scope
157 | request.setValue("text/event-stream, application/json; charset=utf-8", forHTTPHeaderField: "Accept")
158 | request.setValue("no-cache", forHTTPHeaderField: "Cache-Control")
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:163:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
161 |
162 | completionHandler = completion
163 | dataTask = session.dataTask(with: request)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
164 | dataTask?.resume()
165 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:164:19: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
162 | completionHandler = completion
163 | dataTask = session.dataTask(with: request)
164 | dataTask?.resume()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
165 | }
166 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:168:19: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
166 |
167 | func stop() {
168 | dataTask?.cancel()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
169 | completionHandler = nil
170 | }
[23/29] Compiling FlagsmithClient Trait.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:16:35: error: cannot find type 'URLSessionDataDelegate' in scope
14 | /// It manages the connection to the SSE endpoint, processes incoming events,
15 | /// and handles reconnection logic with a backoff strategy.
16 | final class SSEManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
17 | private var _session: URLSession!
18 | private var session: URLSession {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:17:27: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 | /// and handles reconnection logic with a backoff strategy.
16 | final class SSEManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
17 | private var _session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 | private var session: URLSession {
19 | get {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:18:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
16 | final class SSEManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
17 | private var _session: URLSession!
18 | private var session: URLSession {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
19 | get {
20 | propertiesSerialAccessQueue.sync { _session }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:29:28: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
27 | }
28 |
29 | private var _dataTask: URLSessionDataTask?
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
30 | private var dataTask: URLSessionDataTask? {
31 | get {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:30:27: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
28 |
29 | private var _dataTask: URLSessionDataTask?
30 | private var dataTask: URLSessionDataTask? {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 | get {
32 | propertiesSerialAccessQueue.sync { _dataTask }
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:72:37: error: cannot find 'DispatchQueue' in scope
70 |
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
74 | private let reconnectionDelay = ReconnectionDelay()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:72:97: error: cannot infer contextual base in reference to member 'default'
70 |
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
74 | private let reconnectionDelay = ReconnectionDelay()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:73:39: error: cannot find 'DispatchQueue' in scope
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
74 | private let reconnectionDelay = ReconnectionDelay()
75 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:73:100: error: cannot infer contextual base in reference to member 'default'
71 | private var completionHandler: CompletionHandler<FlagEvent>?
72 | private let serialAccessQueue = DispatchQueue(label: "sseFlagsmithSerialAccessQueue", qos: .default)
73 | let propertiesSerialAccessQueue = DispatchQueue(label: "ssePropertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
74 | private let reconnectionDelay = ReconnectionDelay()
75 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:105:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
103 | // MARK: URLSessionDelegate
104 |
105 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
106 | serialAccessQueue.sync {
107 | if let message = String(data: data, encoding: .utf8) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:105:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
103 | // MARK: URLSessionDelegate
104 |
105 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
106 | serialAccessQueue.sync {
107 | if let message = String(data: data, encoding: .utf8) {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:114:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | }
113 |
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | serialAccessQueue.sync {
116 | if task != dataTask {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:114:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 | }
113 |
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 | serialAccessQueue.sync {
116 | if task != dataTask {
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:23:54: error: cannot infer contextual base in reference to member 'barrier'
21 | }
22 | set {
23 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
24 | _session = newValue
25 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:35:54: error: cannot infer contextual base in reference to member 'barrier'
33 | }
34 | set {
35 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
36 | _dataTask = newValue
37 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:78:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
76 | override init() {
77 | super.init()
78 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
79 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
80 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:79:91: error: cannot find 'OperationQueue' in scope
77 | super.init()
78 | let configuration = URLSessionConfiguration.default
79 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
80 | }
81 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:79:19: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
77 | super.init()
78 | let configuration = URLSessionConfiguration.default
79 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
80 | }
81 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:116:16: error: cannot convert value of type 'URLSessionTask' (aka 'AnyObject') to expected argument type 'any (~Copyable & ~Escapable).Type'
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
115 | serialAccessQueue.sync {
116 | if task != dataTask {
| `- error: cannot convert value of type 'URLSessionTask' (aka 'AnyObject') to expected argument type 'any (~Copyable & ~Escapable).Type'
117 | return
118 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:116:24: error: cannot convert value of type 'URLSessionDataTask?' (aka 'Optional<AnyObject>') to expected argument type '(any (~Copyable & ~Escapable).Type)?'
114 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
115 | serialAccessQueue.sync {
116 | if task != dataTask {
| |- error: cannot convert value of type 'URLSessionDataTask?' (aka 'Optional<AnyObject>') to expected argument type '(any (~Copyable & ~Escapable).Type)?'
| `- note: arguments to generic parameter 'Wrapped' ('URLSessionDataTask' (aka 'AnyObject') and 'any (~Copyable & ~Escapable).Type') are expected to be equal
117 | return
118 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:156:23: error: cannot find 'URLRequest' in scope
154 | }
155 |
156 | var request = URLRequest(url: completeEventSourceUrl)
| `- error: cannot find 'URLRequest' in scope
157 | request.setValue("text/event-stream, application/json; charset=utf-8", forHTTPHeaderField: "Accept")
158 | request.setValue("no-cache", forHTTPHeaderField: "Cache-Control")
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:163:28: error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
161 |
162 | completionHandler = completion
163 | dataTask = session.dataTask(with: request)
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'dataTask'
164 | dataTask?.resume()
165 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:164:19: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
162 | completionHandler = completion
163 | dataTask = session.dataTask(with: request)
164 | dataTask?.resume()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'resume'
165 | }
166 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/SSEManager.swift:168:19: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
166 |
167 | func stop() {
168 | dataTask?.cancel()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'cancel'
169 | completionHandler = nil
170 | }
[24/29] Compiling FlagsmithClient FlagEvent.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:35: error: value of type '_' expected to be instance of class or class-constrained type
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
696 |
697 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:35: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
696 |
697 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:303:47: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
301 | }
302 |
303 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
304 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
305 |
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:369:1: error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
367 | // MARK: - HTTPURLResponse Extensions
368 |
369 | extension HTTPURLResponse {
| `- error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
370 | static let dateFormatter: DateFormatter = {
371 | let formatter = DateFormatter()
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:23: error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
696 |
697 | /// Use cached flags as a fallback?
Foundation.URLCache:2:18: note: 'URLCache' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLCache = AnyObject
| `- note: 'URLCache' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:254:23: error: cannot find 'URLRequest' in scope
252 |
253 | // Create request for general flags
254 | let request = URLRequest(url: baseURL.appendingPathComponent("flags/"))
| `- error: cannot find 'URLRequest' in scope
255 |
256 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:257:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
255 |
256 | // Check if we have a cached response
257 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
258 | // Check if cache is still valid based on TTL
259 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:284:23: error: cannot find 'URLRequest' in scope
282 |
283 | guard let url = components.url else { return nil }
284 | let request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
285 |
286 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:287:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
285 |
286 | // Check if we have a cached response
287 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
288 | // Check if cache is still valid based on TTL
289 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:304:49: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
302 |
303 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
304 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
305 |
306 | // Check if we have a cache control header
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:316:47: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
314 | // Check if cache is still valid based on max-age
315 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
316 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
317 | let age = Date().timeIntervalSince(date)
318 | return age < maxAge
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:326:43: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
324 | if cacheConfig.cacheTTL > 0 {
325 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
326 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
327 | let age = Date().timeIntervalSince(date)
328 | return age < cacheConfig.cacheTTL
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:657:35: error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
655 | if lastUpdatedAt < event.updatedAt {
656 | // Evict everything fron the cache
657 | cacheConfig.cache.removeAllCachedResponses()
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
658 |
659 | // Now we can get the new values, which we can emit to the flagUpdateFlow if used
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[25/29] Compiling FlagsmithClient Flagsmith+Concurrency.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:35: error: value of type '_' expected to be instance of class or class-constrained type
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
696 |
697 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:35: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
696 |
697 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:303:47: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
301 | }
302 |
303 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
304 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
305 |
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:369:1: error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
367 | // MARK: - HTTPURLResponse Extensions
368 |
369 | extension HTTPURLResponse {
| `- error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
370 | static let dateFormatter: DateFormatter = {
371 | let formatter = DateFormatter()
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:23: error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
696 |
697 | /// Use cached flags as a fallback?
Foundation.URLCache:2:18: note: 'URLCache' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLCache = AnyObject
| `- note: 'URLCache' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:254:23: error: cannot find 'URLRequest' in scope
252 |
253 | // Create request for general flags
254 | let request = URLRequest(url: baseURL.appendingPathComponent("flags/"))
| `- error: cannot find 'URLRequest' in scope
255 |
256 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:257:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
255 |
256 | // Check if we have a cached response
257 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
258 | // Check if cache is still valid based on TTL
259 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:284:23: error: cannot find 'URLRequest' in scope
282 |
283 | guard let url = components.url else { return nil }
284 | let request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
285 |
286 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:287:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
285 |
286 | // Check if we have a cached response
287 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
288 | // Check if cache is still valid based on TTL
289 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:304:49: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
302 |
303 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
304 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
305 |
306 | // Check if we have a cache control header
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:316:47: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
314 | // Check if cache is still valid based on max-age
315 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
316 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
317 | let age = Date().timeIntervalSince(date)
318 | return age < maxAge
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:326:43: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
324 | if cacheConfig.cacheTTL > 0 {
325 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
326 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
327 | let age = Date().timeIntervalSince(date)
328 | return age < cacheConfig.cacheTTL
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:657:35: error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
655 | if lastUpdatedAt < event.updatedAt {
656 | // Evict everything fron the cache
657 | cacheConfig.cache.removeAllCachedResponses()
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
658 |
659 | // Now we can get the new values, which we can emit to the flagUpdateFlow if used
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[26/29] Compiling FlagsmithClient Flagsmith.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:35: error: value of type '_' expected to be instance of class or class-constrained type
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
696 |
697 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:35: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
696 |
697 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:303:47: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
301 | }
302 |
303 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
304 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
305 |
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:369:1: error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
367 | // MARK: - HTTPURLResponse Extensions
368 |
369 | extension HTTPURLResponse {
| `- error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
370 | static let dateFormatter: DateFormatter = {
371 | let formatter = DateFormatter()
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:695:23: error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
693 | public final class CacheConfig {
694 | /// Cache to use when enabled, defaults to the shared app cache
695 | public var cache: URLCache = .shared
| `- error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
696 |
697 | /// Use cached flags as a fallback?
Foundation.URLCache:2:18: note: 'URLCache' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLCache = AnyObject
| `- note: 'URLCache' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:254:23: error: cannot find 'URLRequest' in scope
252 |
253 | // Create request for general flags
254 | let request = URLRequest(url: baseURL.appendingPathComponent("flags/"))
| `- error: cannot find 'URLRequest' in scope
255 |
256 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:257:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
255 |
256 | // Check if we have a cached response
257 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
258 | // Check if cache is still valid based on TTL
259 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:284:23: error: cannot find 'URLRequest' in scope
282 |
283 | guard let url = components.url else { return nil }
284 | let request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
285 |
286 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:287:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
285 |
286 | // Check if we have a cached response
287 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
288 | // Check if cache is still valid based on TTL
289 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:304:49: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
302 |
303 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
304 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
305 |
306 | // Check if we have a cache control header
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:316:47: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
314 | // Check if cache is still valid based on max-age
315 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
316 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
317 | let age = Date().timeIntervalSince(date)
318 | return age < maxAge
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:326:43: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
324 | if cacheConfig.cacheTTL > 0 {
325 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
326 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
327 | let age = Date().timeIntervalSince(date)
328 | return age < cacheConfig.cacheTTL
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:657:35: error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
655 | if lastUpdatedAt < event.updatedAt {
656 | // Evict everything fron the cache
657 | cacheConfig.cache.removeAllCachedResponses()
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
658 |
659 | // Now we can get the new values, which we can emit to the flagUpdateFlow if used
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[27/29] Compiling FlagsmithClient FlagsmithError.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:14:35: error: cannot find type 'URLSessionDataDelegate' in scope
12 |
13 | /// Handles interaction with a **Flagsmith** api.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
15 | private var _session: URLSession!
16 | private var session: URLSession {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:15:27: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
13 | /// Handles interaction with a **Flagsmith** api.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
15 | private var _session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
16 | private var session: URLSession {
17 | get {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:16:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
15 | private var _session: URLSession!
16 | private var session: URLSession {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 | get {
18 | propertiesSerialAccessQueue.sync { _session }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:68:37: error: cannot find 'DispatchQueue' in scope
66 | private var tasksToCompletionHandlers: [Int: @Sendable (Result<Data, any Error>) -> Void] = [:]
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:68:94: error: cannot infer contextual base in reference to member 'default'
66 | private var tasksToCompletionHandlers: [Int: @Sendable (Result<Data, any Error>) -> Void] = [:]
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:71:33: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
72 |
73 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:71:60: error: cannot infer contextual base in reference to member 'ephemeral'
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
| `- error: cannot infer contextual base in reference to member 'ephemeral'
72 |
73 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
79 | }
80 |
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
79 | }
80 |
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:104: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:99:61: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
100 | {
101 | serialAccessQueue.sync {
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | }
112 |
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:46: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | }
112 |
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:122:62: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
123 | {
124 | completionHandler(.allow)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:297:58: error: cannot find type 'URLRequest' in scope
295 | }
296 |
297 | private func updateLastUpdatedFromRequest(_ request: URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
298 | // Extract the lastUpdatedAt from the updatedAt header
299 | if let lastUpdatedAt = request.allHTTPHeaderFields?["x-flagsmith-document-updated-at"] {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:21:54: error: cannot infer contextual base in reference to member 'barrier'
19 | }
20 | set {
21 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
22 | _session = newValue
23 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:34:54: error: cannot infer contextual base in reference to member 'barrier'
32 | }
33 | set {
34 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
35 | _baseURL = newValue
36 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:47:54: error: cannot infer contextual base in reference to member 'barrier'
45 | }
46 | set {
47 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
48 | _apiKey = newValue
49 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:59:54: error: cannot infer contextual base in reference to member 'barrier'
57 | }
58 | set {
59 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
60 | _lastUpdatedAt = newValue
61 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:75:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
73 | override init() {
74 | super.init()
75 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:77:43: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
75 | let configuration = URLSessionConfiguration.default
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
79 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:78:91: error: cannot find 'OperationQueue' in scope
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
79 | }
80 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:78:19: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
79 | }
80 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:86:25: error: cannot find 'DispatchQueue' in scope
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
85 | if let error = error {
86 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
| `- error: cannot find 'DispatchQueue' in scope
87 | } else {
88 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:89:25: error: cannot find 'DispatchQueue' in scope
87 | } else {
88 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
89 | DispatchQueue.main.async { completion(.success(data)) }
| `- error: cannot find 'DispatchQueue' in scope
90 | }
91 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:83:36: warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
| `- warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
85 | if let error = error {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:84:72: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
85 | if let error = error {
86 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:105:17: error: cannot find 'DispatchQueue' in scope
103 | if Flagsmith.shared.cacheConfig.useCache {
104 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
105 | DispatchQueue.main.async { completionHandler(newResponse) }
| `- error: cannot find 'DispatchQueue' in scope
106 | } else {
107 | // When caching is disabled, don't cache the response
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:108:17: error: cannot find 'DispatchQueue' in scope
106 | } else {
107 | // When caching is disabled, don't cache the response
108 | DispatchQueue.main.async { completionHandler(nil) }
| `- error: cannot find 'DispatchQueue' in scope
109 | }
110 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:104:52: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
102 | // intercept and modify the cache settings for the response
103 | if Flagsmith.shared.cacheConfig.useCache {
104 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
105 | DispatchQueue.main.async { completionHandler(newResponse) }
106 | } else {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:115:53: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
116 | existingData.append(data)
117 | tasksToData[dataTask.taskIdentifier] = existingData
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:124:28: error: cannot infer contextual base in reference to member 'allow'
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
124 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
125 | }
126 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:142:22: error: cannot find type 'URLRequest' in scope
140 | }
141 |
142 | var request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
143 | do {
144 | request = try router.request(baseUrl: baseURL ?? self.baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:93:72: error: cannot find type 'URLRequest' in scope
91 | func request(baseUrl: URL,
92 | apiKey: String,
93 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
94 | {
95 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:151:32: error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
149 |
150 | // set the cache policy based on Flagsmith settings
151 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
| `- error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
152 | if Flagsmith.shared.cacheConfig.useCache {
153 | request.cachePolicy = .useProtocolCachePolicy
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:153:36: error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
151 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
152 | if Flagsmith.shared.cacheConfig.useCache {
153 | request.cachePolicy = .useProtocolCachePolicy
| `- error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
154 | if Flagsmith.shared.cacheConfig.skipAPI {
155 | request.cachePolicy = .returnCacheDataElseLoad
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:155:40: error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
153 | request.cachePolicy = .useProtocolCachePolicy
154 | if Flagsmith.shared.cacheConfig.skipAPI {
155 | request.cachePolicy = .returnCacheDataElseLoad
| `- error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
156 | }
157 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:165:99: error: cannot find 'OperationQueue' in scope
163 | let configuration = URLSessionConfiguration.default
164 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
165 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
166 | }
167 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:162:24: error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
160 | serialAccessQueue.sync {
161 | // Update session cache configuration if it has changed (must be done inside the serial queue)
162 | if session.configuration.urlCache !== Flagsmith.shared.cacheConfig.cache {
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
163 | let configuration = URLSessionConfiguration.default
164 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:207:22: error: cannot find type 'URLRequest' in scope
205 | return {}
206 | }
207 | let request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
208 | do {
209 | request = try Router.postEvents(events: events).request(baseUrl: baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:218:46: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 | completion(.failure(FlagsmithError.unhandled(error)))
217 | } else if let response = response as? HTTPURLResponse {
218 | completion(.success(response.statusCode))
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
219 | } else {
220 | completion(.failure(FlagsmithError.unhandled(URLError(.badServerResponse))))
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:239:17: warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
237 | switch result {
238 | case let .failure(error):
239 | completion(.failure(error))
| `- warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
240 | case let .success(data):
241 | do {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:266:51: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
264 |
265 | // Check if response is already cached
266 | if Flagsmith.shared.cacheConfig.cache.cachedResponse(for: request) != nil {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
267 | return // Already cached
268 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:271:32: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
269 |
270 | // Create a cacheable response
271 | let httpResponse = HTTPURLResponse(
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
272 | url: request.url!,
273 | statusCode: 200,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:281:34: error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
279 | )!
280 |
281 | let cachedResponse = CachedURLResponse(
| `- error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
282 | response: httpResponse,
283 | data: data,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:284:27: error: 'nil' requires a contextual type
282 | response: httpResponse,
283 | data: data,
284 | userInfo: nil,
| `- error: 'nil' requires a contextual type
285 | storagePolicy: .allowed
286 | )
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:285:33: error: cannot infer contextual base in reference to member 'allowed'
283 | data: data,
284 | userInfo: nil,
285 | storagePolicy: .allowed
| `- error: cannot infer contextual base in reference to member 'allowed'
286 | )
287 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:289:48: error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
287 |
288 | // Store the response in cache
289 | Flagsmith.shared.cacheConfig.cache.storeCachedResponse(cachedResponse, for: request)
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
290 |
291 | } catch {
[#SendableMetatypes]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-metatypes>
[28/29] Compiling FlagsmithClient Identity.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:14:35: error: cannot find type 'URLSessionDataDelegate' in scope
12 |
13 | /// Handles interaction with a **Flagsmith** api.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
15 | private var _session: URLSession!
16 | private var session: URLSession {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:15:27: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
13 | /// Handles interaction with a **Flagsmith** api.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
15 | private var _session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
16 | private var session: URLSession {
17 | get {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:16:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
15 | private var _session: URLSession!
16 | private var session: URLSession {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 | get {
18 | propertiesSerialAccessQueue.sync { _session }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:68:37: error: cannot find 'DispatchQueue' in scope
66 | private var tasksToCompletionHandlers: [Int: @Sendable (Result<Data, any Error>) -> Void] = [:]
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:68:94: error: cannot infer contextual base in reference to member 'default'
66 | private var tasksToCompletionHandlers: [Int: @Sendable (Result<Data, any Error>) -> Void] = [:]
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:71:33: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
72 |
73 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:71:60: error: cannot infer contextual base in reference to member 'ephemeral'
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
| `- error: cannot infer contextual base in reference to member 'ephemeral'
72 |
73 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
79 | }
80 |
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
79 | }
80 |
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:104: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:99:61: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
100 | {
101 | serialAccessQueue.sync {
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | }
112 |
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:46: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | }
112 |
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:122:62: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
123 | {
124 | completionHandler(.allow)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:297:58: error: cannot find type 'URLRequest' in scope
295 | }
296 |
297 | private func updateLastUpdatedFromRequest(_ request: URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
298 | // Extract the lastUpdatedAt from the updatedAt header
299 | if let lastUpdatedAt = request.allHTTPHeaderFields?["x-flagsmith-document-updated-at"] {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:21:54: error: cannot infer contextual base in reference to member 'barrier'
19 | }
20 | set {
21 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
22 | _session = newValue
23 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:34:54: error: cannot infer contextual base in reference to member 'barrier'
32 | }
33 | set {
34 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
35 | _baseURL = newValue
36 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:47:54: error: cannot infer contextual base in reference to member 'barrier'
45 | }
46 | set {
47 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
48 | _apiKey = newValue
49 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:59:54: error: cannot infer contextual base in reference to member 'barrier'
57 | }
58 | set {
59 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
60 | _lastUpdatedAt = newValue
61 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:75:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
73 | override init() {
74 | super.init()
75 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:77:43: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
75 | let configuration = URLSessionConfiguration.default
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
79 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:78:91: error: cannot find 'OperationQueue' in scope
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
79 | }
80 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:78:19: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
79 | }
80 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:86:25: error: cannot find 'DispatchQueue' in scope
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
85 | if let error = error {
86 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
| `- error: cannot find 'DispatchQueue' in scope
87 | } else {
88 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:89:25: error: cannot find 'DispatchQueue' in scope
87 | } else {
88 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
89 | DispatchQueue.main.async { completion(.success(data)) }
| `- error: cannot find 'DispatchQueue' in scope
90 | }
91 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:83:36: warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
| `- warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
85 | if let error = error {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:84:72: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
85 | if let error = error {
86 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:105:17: error: cannot find 'DispatchQueue' in scope
103 | if Flagsmith.shared.cacheConfig.useCache {
104 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
105 | DispatchQueue.main.async { completionHandler(newResponse) }
| `- error: cannot find 'DispatchQueue' in scope
106 | } else {
107 | // When caching is disabled, don't cache the response
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:108:17: error: cannot find 'DispatchQueue' in scope
106 | } else {
107 | // When caching is disabled, don't cache the response
108 | DispatchQueue.main.async { completionHandler(nil) }
| `- error: cannot find 'DispatchQueue' in scope
109 | }
110 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:104:52: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
102 | // intercept and modify the cache settings for the response
103 | if Flagsmith.shared.cacheConfig.useCache {
104 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
105 | DispatchQueue.main.async { completionHandler(newResponse) }
106 | } else {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:115:53: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
116 | existingData.append(data)
117 | tasksToData[dataTask.taskIdentifier] = existingData
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:124:28: error: cannot infer contextual base in reference to member 'allow'
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
124 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
125 | }
126 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:142:22: error: cannot find type 'URLRequest' in scope
140 | }
141 |
142 | var request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
143 | do {
144 | request = try router.request(baseUrl: baseURL ?? self.baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:93:72: error: cannot find type 'URLRequest' in scope
91 | func request(baseUrl: URL,
92 | apiKey: String,
93 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
94 | {
95 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:151:32: error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
149 |
150 | // set the cache policy based on Flagsmith settings
151 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
| `- error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
152 | if Flagsmith.shared.cacheConfig.useCache {
153 | request.cachePolicy = .useProtocolCachePolicy
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:153:36: error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
151 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
152 | if Flagsmith.shared.cacheConfig.useCache {
153 | request.cachePolicy = .useProtocolCachePolicy
| `- error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
154 | if Flagsmith.shared.cacheConfig.skipAPI {
155 | request.cachePolicy = .returnCacheDataElseLoad
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:155:40: error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
153 | request.cachePolicy = .useProtocolCachePolicy
154 | if Flagsmith.shared.cacheConfig.skipAPI {
155 | request.cachePolicy = .returnCacheDataElseLoad
| `- error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
156 | }
157 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:165:99: error: cannot find 'OperationQueue' in scope
163 | let configuration = URLSessionConfiguration.default
164 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
165 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
166 | }
167 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:162:24: error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
160 | serialAccessQueue.sync {
161 | // Update session cache configuration if it has changed (must be done inside the serial queue)
162 | if session.configuration.urlCache !== Flagsmith.shared.cacheConfig.cache {
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
163 | let configuration = URLSessionConfiguration.default
164 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:207:22: error: cannot find type 'URLRequest' in scope
205 | return {}
206 | }
207 | let request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
208 | do {
209 | request = try Router.postEvents(events: events).request(baseUrl: baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:218:46: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 | completion(.failure(FlagsmithError.unhandled(error)))
217 | } else if let response = response as? HTTPURLResponse {
218 | completion(.success(response.statusCode))
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
219 | } else {
220 | completion(.failure(FlagsmithError.unhandled(URLError(.badServerResponse))))
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:239:17: warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
237 | switch result {
238 | case let .failure(error):
239 | completion(.failure(error))
| `- warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
240 | case let .success(data):
241 | do {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:266:51: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
264 |
265 | // Check if response is already cached
266 | if Flagsmith.shared.cacheConfig.cache.cachedResponse(for: request) != nil {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
267 | return // Already cached
268 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:271:32: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
269 |
270 | // Create a cacheable response
271 | let httpResponse = HTTPURLResponse(
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
272 | url: request.url!,
273 | statusCode: 200,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:281:34: error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
279 | )!
280 |
281 | let cachedResponse = CachedURLResponse(
| `- error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
282 | response: httpResponse,
283 | data: data,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:284:27: error: 'nil' requires a contextual type
282 | response: httpResponse,
283 | data: data,
284 | userInfo: nil,
| `- error: 'nil' requires a contextual type
285 | storagePolicy: .allowed
286 | )
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:285:33: error: cannot infer contextual base in reference to member 'allowed'
283 | data: data,
284 | userInfo: nil,
285 | storagePolicy: .allowed
| `- error: cannot infer contextual base in reference to member 'allowed'
286 | )
287 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:289:48: error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
287 |
288 | // Store the response in cache
289 | Flagsmith.shared.cacheConfig.cache.storeCachedResponse(cachedResponse, for: request)
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
290 |
291 | } catch {
[#SendableMetatypes]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-metatypes>
[29/29] Compiling FlagsmithClient APIManager.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:14:35: error: cannot find type 'URLSessionDataDelegate' in scope
12 |
13 | /// Handles interaction with a **Flagsmith** api.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
| `- error: cannot find type 'URLSessionDataDelegate' in scope
15 | private var _session: URLSession!
16 | private var session: URLSession {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:15:27: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
13 | /// Handles interaction with a **Flagsmith** api.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
15 | private var _session: URLSession!
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
16 | private var session: URLSession {
17 | get {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:16:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
14 | final class APIManager: NSObject, URLSessionDataDelegate, @unchecked Sendable {
15 | private var _session: URLSession!
16 | private var session: URLSession {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 | get {
18 | propertiesSerialAccessQueue.sync { _session }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:68:37: error: cannot find 'DispatchQueue' in scope
66 | private var tasksToCompletionHandlers: [Int: @Sendable (Result<Data, any Error>) -> Void] = [:]
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:68:94: error: cannot infer contextual base in reference to member 'default'
66 | private var tasksToCompletionHandlers: [Int: @Sendable (Result<Data, any Error>) -> Void] = [:]
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:39: error: cannot find 'DispatchQueue' in scope
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot find 'DispatchQueue' in scope
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:69:97: error: cannot infer contextual base in reference to member 'default'
67 | private var tasksToData: [Int: Data] = [:]
68 | private let serialAccessQueue = DispatchQueue(label: "flagsmithSerialAccessQueue", qos: .default)
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
| `- error: cannot infer contextual base in reference to member 'default'
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:71:33: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
72 |
73 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:71:60: error: cannot infer contextual base in reference to member 'ephemeral'
69 | let propertiesSerialAccessQueue = DispatchQueue(label: "propertiesSerialAccessQueue", qos: .default)
70 | /// Sends events: never cached, and answering off the main queue.
71 | private let eventsSession = URLSession(configuration: .ephemeral)
| `- error: cannot infer contextual base in reference to member 'ephemeral'
72 |
73 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
79 | }
80 |
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
79 | }
80 |
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
| `- error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
Foundation.URLSessionTask:2:18: note: 'URLSessionTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionTask = AnyObject
| `- note: 'URLSessionTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:98:104: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
96 | }
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
100 | {
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:99:61: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
97 |
98 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
99 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
100 | {
101 | serialAccessQueue.sync {
Foundation.CachedURLResponse:2:18: note: 'CachedURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias CachedURLResponse = AnyObject
| `- note: 'CachedURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | }
112 |
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:46: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 | }
112 |
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:122:62: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
123 | {
124 | completionHandler(.allow)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
| `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLSessionDataTask:2:18: note: 'URLSessionDataTask' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSessionDataTask = AnyObject
| `- note: 'URLSessionDataTask' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:121:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 | }
120 |
121 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
| `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
| `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:297:58: error: cannot find type 'URLRequest' in scope
295 | }
296 |
297 | private func updateLastUpdatedFromRequest(_ request: URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
298 | // Extract the lastUpdatedAt from the updatedAt header
299 | if let lastUpdatedAt = request.allHTTPHeaderFields?["x-flagsmith-document-updated-at"] {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:21:54: error: cannot infer contextual base in reference to member 'barrier'
19 | }
20 | set {
21 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
22 | _session = newValue
23 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:34:54: error: cannot infer contextual base in reference to member 'barrier'
32 | }
33 | set {
34 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
35 | _baseURL = newValue
36 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:47:54: error: cannot infer contextual base in reference to member 'barrier'
45 | }
46 | set {
47 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
48 | _apiKey = newValue
49 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:59:54: error: cannot infer contextual base in reference to member 'barrier'
57 | }
58 | set {
59 | propertiesSerialAccessQueue.sync(flags: .barrier) {
| `- error: cannot infer contextual base in reference to member 'barrier'
60 | _lastUpdatedAt = newValue
61 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:75:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
73 | override init() {
74 | super.init()
75 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:77:43: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
75 | let configuration = URLSessionConfiguration.default
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
79 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:78:91: error: cannot find 'OperationQueue' in scope
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
79 | }
80 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:78:19: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
76 | // Set initial cache configuration - this will be updated when cache settings change
77 | configuration.urlCache = URLCache.shared
78 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
79 | }
80 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:86:25: error: cannot find 'DispatchQueue' in scope
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
85 | if let error = error {
86 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
| `- error: cannot find 'DispatchQueue' in scope
87 | } else {
88 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:89:25: error: cannot find 'DispatchQueue' in scope
87 | } else {
88 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
89 | DispatchQueue.main.async { completion(.success(data)) }
| `- error: cannot find 'DispatchQueue' in scope
90 | }
91 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:83:36: warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
81 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
| `- warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
85 | if let error = error {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:84:72: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
82 | serialAccessQueue.sync {
83 | if let dataTask = task as? URLSessionDataTask {
84 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
85 | if let error = error {
86 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:105:17: error: cannot find 'DispatchQueue' in scope
103 | if Flagsmith.shared.cacheConfig.useCache {
104 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
105 | DispatchQueue.main.async { completionHandler(newResponse) }
| `- error: cannot find 'DispatchQueue' in scope
106 | } else {
107 | // When caching is disabled, don't cache the response
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:108:17: error: cannot find 'DispatchQueue' in scope
106 | } else {
107 | // When caching is disabled, don't cache the response
108 | DispatchQueue.main.async { completionHandler(nil) }
| `- error: cannot find 'DispatchQueue' in scope
109 | }
110 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:104:52: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
102 | // intercept and modify the cache settings for the response
103 | if Flagsmith.shared.cacheConfig.useCache {
104 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
105 | DispatchQueue.main.async { completionHandler(newResponse) }
106 | } else {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:115:53: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
113 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
114 | serialAccessQueue.sync {
115 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
116 | existingData.append(data)
117 | tasksToData[dataTask.taskIdentifier] = existingData
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:124:28: error: cannot infer contextual base in reference to member 'allow'
122 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
123 | {
124 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
125 | }
126 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:142:22: error: cannot find type 'URLRequest' in scope
140 | }
141 |
142 | var request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
143 | do {
144 | request = try router.request(baseUrl: baseURL ?? self.baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:93:72: error: cannot find type 'URLRequest' in scope
91 | func request(baseUrl: URL,
92 | apiKey: String,
93 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
94 | {
95 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:151:32: error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
149 |
150 | // set the cache policy based on Flagsmith settings
151 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
| `- error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
152 | if Flagsmith.shared.cacheConfig.useCache {
153 | request.cachePolicy = .useProtocolCachePolicy
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:153:36: error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
151 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
152 | if Flagsmith.shared.cacheConfig.useCache {
153 | request.cachePolicy = .useProtocolCachePolicy
| `- error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
154 | if Flagsmith.shared.cacheConfig.skipAPI {
155 | request.cachePolicy = .returnCacheDataElseLoad
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:155:40: error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
153 | request.cachePolicy = .useProtocolCachePolicy
154 | if Flagsmith.shared.cacheConfig.skipAPI {
155 | request.cachePolicy = .returnCacheDataElseLoad
| `- error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
156 | }
157 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:165:99: error: cannot find 'OperationQueue' in scope
163 | let configuration = URLSessionConfiguration.default
164 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
165 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
166 | }
167 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:162:24: error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
160 | serialAccessQueue.sync {
161 | // Update session cache configuration if it has changed (must be done inside the serial queue)
162 | if session.configuration.urlCache !== Flagsmith.shared.cacheConfig.cache {
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
163 | let configuration = URLSessionConfiguration.default
164 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:207:22: error: cannot find type 'URLRequest' in scope
205 | return {}
206 | }
207 | let request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
208 | do {
209 | request = try Router.postEvents(events: events).request(baseUrl: baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:218:46: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 | completion(.failure(FlagsmithError.unhandled(error)))
217 | } else if let response = response as? HTTPURLResponse {
218 | completion(.success(response.statusCode))
| `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
219 | } else {
220 | completion(.failure(FlagsmithError.unhandled(URLError(.badServerResponse))))
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:239:17: warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
237 | switch result {
238 | case let .failure(error):
239 | completion(.failure(error))
| `- warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
240 | case let .success(data):
241 | do {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:266:51: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
264 |
265 | // Check if response is already cached
266 | if Flagsmith.shared.cacheConfig.cache.cachedResponse(for: request) != nil {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
267 | return // Already cached
268 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:271:32: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
269 |
270 | // Create a cacheable response
271 | let httpResponse = HTTPURLResponse(
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
272 | url: request.url!,
273 | statusCode: 200,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:281:34: error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
279 | )!
280 |
281 | let cachedResponse = CachedURLResponse(
| `- error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
282 | response: httpResponse,
283 | data: data,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:284:27: error: 'nil' requires a contextual type
282 | response: httpResponse,
283 | data: data,
284 | userInfo: nil,
| `- error: 'nil' requires a contextual type
285 | storagePolicy: .allowed
286 | )
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:285:33: error: cannot infer contextual base in reference to member 'allowed'
283 | data: data,
284 | userInfo: nil,
285 | storagePolicy: .allowed
| `- error: cannot infer contextual base in reference to member 'allowed'
286 | )
287 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:289:48: error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
287 |
288 | // Store the response in cache
289 | Flagsmith.shared.cacheConfig.cache.storeCachedResponse(cachedResponse, for: request)
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
290 |
291 | } catch {
[#SendableMetatypes]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-metatypes>
BUILD FAILURE 6.2 wasm