Build Information
Failed to build FlagsmithClient, reference main (bb8564), with Swift 6.2 for Wasm on 20 Apr 2026 05:20:50 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-4606859-3":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/swiftpackageindex/spi-images:wasm-6.2-latest swift build --swift-sdk swift-6.2-RELEASE_wasm 2>&1Build Log
========================================
RunAll
========================================
Builder version: 4.70.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/Flagsmith/flagsmith-ios-client.git
Reference: main
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
From https://github.com/Flagsmith/flagsmith-ios-client
* branch main -> FETCH_HEAD
* [new branch] main -> origin/main
HEAD is now at bb8564b chore(main): release 3.10.0 (#102)
Cloned https://github.com/Flagsmith/flagsmith-ios-client.git
Revision (git rev-parse @):
bb8564b4b22e0602a83b5e45390793c23e3ec492
SUCCESS checkout https://github.com/Flagsmith/flagsmith-ios-client.git at main
========================================
Build
========================================
Selected platform: wasm
Swift version: 6.2
Building package at path: $PWD
https://github.com/Flagsmith/flagsmith-ios-client.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-3":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/swiftpackageindex/spi-images:wasm-6.2-latest swift build --swift-sdk swift-6.2-RELEASE_wasm 2>&1
wasm-6.2-latest: Pulling from swiftpackageindex/spi-images
Digest: sha256:2a8b2d9e022a9894c61e0736af7cdaa1ee64c002dbb133a55c0d7e8980b3ad16
Status: Image is up to date for registry.gitlab.com/swiftpackageindex/spi-images:wasm-6.2-latest
Fetching https://github.com/nicklockwood/SwiftFormat
Fetching https://github.com/realm/SwiftLint.git
[1/56115] Fetching swiftformat
[2246/217189] Fetching swiftformat, swiftlint
Fetched https://github.com/nicklockwood/SwiftFormat from cache (62.29s)
Fetched https://github.com/realm/SwiftLint.git from cache (63.67s)
Computing version for https://github.com/realm/SwiftLint.git
Computed https://github.com/realm/SwiftLint.git at 0.63.2 (66.87s)
Fetching https://github.com/JohnSundell/CollectionConcurrencyKit.git
Fetching https://github.com/krzyzanowskim/CryptoSwift.git
Fetching https://github.com/swiftlang/swift-syntax.git
Fetching https://github.com/jpsim/SourceKitten.git
Fetching https://github.com/ileitch/swift-filename-matcher
Fetching https://github.com/jpsim/Yams.git
[1/13341] Fetching cryptoswift
[1869/13404] Fetching cryptoswift, swift-filename-matcher
[1932/29604] Fetching cryptoswift, swift-filename-matcher, sourcekitten
[6954/104585] Fetching cryptoswift, swift-filename-matcher, sourcekitten, swift-syntax
[9466/104686] Fetching cryptoswift, swift-filename-matcher, sourcekitten, swift-syntax, collectionconcurrencykit
[15220/116237] Fetching cryptoswift, swift-filename-matcher, sourcekitten, swift-syntax, collectionconcurrencykit, yams
Fetched https://github.com/ileitch/swift-filename-matcher from cache (3.74s)
[36108/116174] Fetching cryptoswift, sourcekitten, swift-syntax, collectionconcurrencykit, yams
Fetching https://github.com/apple/swift-argument-parser.git
[64551/133703] Fetching cryptoswift, sourcekitten, swift-syntax, collectionconcurrencykit, yams, swift-argument-parser
Fetched https://github.com/krzyzanowskim/CryptoSwift.git from cache (9.51s)
[104616/120362] Fetching sourcekitten, swift-syntax, collectionconcurrencykit, yams, swift-argument-parser
Fetching https://github.com/scottrhoyt/SwiftyTextTable.git
Fetched https://github.com/jpsim/Yams.git from cache (9.95s)
[96065/108811] Fetching sourcekitten, swift-syntax, collectionconcurrencykit, swift-argument-parser
Fetched https://github.com/apple/swift-argument-parser.git from cache (6.79s)
[1/929] Fetching swiftytexttable
Fetched https://github.com/scottrhoyt/SwiftyTextTable.git from cache (6.55s)
Fetched https://github.com/JohnSundell/CollectionConcurrencyKit.git from cache (22.10s)
Fetched https://github.com/jpsim/SourceKitten.git from cache (22.16s)
Fetched https://github.com/swiftlang/swift-syntax.git from cache (22.22s)
Computing version for https://github.com/ileitch/swift-filename-matcher
Computed https://github.com/ileitch/swift-filename-matcher at 2.0.1 (26.60s)
Computing version for https://github.com/krzyzanowskim/CryptoSwift.git
Computed https://github.com/krzyzanowskim/CryptoSwift.git at 1.9.0 (4.36s)
Computing version for https://github.com/JohnSundell/CollectionConcurrencyKit.git
Computed https://github.com/JohnSundell/CollectionConcurrencyKit.git at 0.2.0 (4.36s)
Computing version for https://github.com/scottrhoyt/SwiftyTextTable.git
Computed https://github.com/scottrhoyt/SwiftyTextTable.git at 0.9.0 (6.68s)
Computing version for https://github.com/jpsim/SourceKitten.git
Computed https://github.com/jpsim/SourceKitten.git at 0.37.3 (4.90s)
Fetching https://github.com/drmohundro/SWXMLHash.git
[1/2858] Fetching swxmlhash
Fetched https://github.com/drmohundro/SWXMLHash.git from cache (8.79s)
Computing version for https://github.com/jpsim/Yams.git
Computed https://github.com/jpsim/Yams.git at 6.2.1 (15.96s)
Computing version for https://github.com/drmohundro/SWXMLHash.git
Computed https://github.com/drmohundro/SWXMLHash.git at 7.0.2 (4.93s)
Computing version for https://github.com/apple/swift-argument-parser.git
Computed https://github.com/apple/swift-argument-parser.git at 1.7.1 (4.56s)
Computing version for https://github.com/nicklockwood/SwiftFormat
Computed https://github.com/nicklockwood/SwiftFormat at 0.61.0 (0.49s)
Computing version for https://github.com/swiftlang/swift-syntax.git
Computed https://github.com/swiftlang/swift-syntax.git at 604.0.0-prerelease-2026-01-20 (0.65s)
Creating working copy for https://github.com/realm/SwiftLint.git
Working copy of https://github.com/realm/SwiftLint.git resolved at 0.63.2
Creating working copy for https://github.com/JohnSundell/CollectionConcurrencyKit.git
Working copy of https://github.com/JohnSundell/CollectionConcurrencyKit.git resolved at 0.2.0
Creating working copy for https://github.com/ileitch/swift-filename-matcher
Working copy of https://github.com/ileitch/swift-filename-matcher resolved at 2.0.1
Creating working copy for https://github.com/apple/swift-argument-parser.git
Working copy of https://github.com/apple/swift-argument-parser.git resolved at 1.7.1
Creating working copy for https://github.com/nicklockwood/SwiftFormat
Working copy of https://github.com/nicklockwood/SwiftFormat resolved at 0.61.0
Creating working copy for https://github.com/scottrhoyt/SwiftyTextTable.git
Working copy of https://github.com/scottrhoyt/SwiftyTextTable.git resolved at 0.9.0
Creating working copy for https://github.com/swiftlang/swift-syntax.git
Working copy of https://github.com/swiftlang/swift-syntax.git resolved at 604.0.0-prerelease-2026-01-20
Creating working copy for https://github.com/drmohundro/SWXMLHash.git
Working copy of https://github.com/drmohundro/SWXMLHash.git resolved at 7.0.2
Creating working copy for https://github.com/krzyzanowskim/CryptoSwift.git
Working copy of https://github.com/krzyzanowskim/CryptoSwift.git resolved at 1.9.0
Creating working copy for https://github.com/jpsim/Yams.git
Working copy of https://github.com/jpsim/Yams.git resolved at 6.2.1
Creating working copy for https://github.com/jpsim/SourceKitten.git
Working copy of https://github.com/jpsim/SourceKitten.git resolved at 0.37.3
Downloading binary artifact https://github.com/realm/SwiftLint/releases/download/0.63.2/SwiftLintBinary.artifactbundle.zip
[16375/72588246] Downloading https://github.com/realm/SwiftLint/releases/download/0.63.2/SwiftLintBinary.artifactbundle.zip
Downloaded https://github.com/realm/SwiftLint/releases/download/0.63.2/SwiftLintBinary.artifactbundle.zip (8.71s)
warning: 'spi-builder-workspace': Invalid Resource 'test-config.json': File not found.
[1/1] Compiling plugin SwiftFormatPlugin
[2/2] Compiling plugin SwiftLintCommandPlugin
[3/3] Compiling plugin SwiftLintBuildToolPlugin
[4/4] Compiling plugin GenerateManual
[5/5] Compiling plugin GenerateDoccReference
Building for debugging...
[5/8] Write sources
[5/8] Copying PrivacyInfo.xcprivacy
[7/8] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[9/25] Compiling FlagsmithClient Feature.swift
[10/25] Compiling FlagsmithClient Flag.swift
[11/25] Compiling FlagsmithClient FlagEvent.swift
[12/25] Emitting module FlagsmithClient
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: value of type '_' expected to be instance of class or class-constrained type
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:270:47: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
268 | }
269 |
270 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
271 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
272 |
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:336:1: error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
334 | // MARK: - HTTPURLResponse Extensions
335 |
336 | extension HTTPURLResponse {
| `- error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
337 | static let dateFormatter: DateFormatter = {
338 | let formatter = DateFormatter()
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:23: error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
569 |
570 | /// 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: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 |
/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 |
/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 |
71 | override init() {
/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 |
71 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:79:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
77 | }
78 |
79 | 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.
80 | serialAccessQueue.sync {
81 | 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:79:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
77 | }
78 |
79 | 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.
80 | serialAccessQueue.sync {
81 | 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:96:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:96:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:96:104: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:97:61: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
95 |
96 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
98 | {
99 | 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:111:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 | }
110 |
111 | 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.
112 | serialAccessQueue.sync {
113 | 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:111:46: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 | }
110 |
111 | 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.
112 | serialAccessQueue.sync {
113 | 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:120:62: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
118 |
119 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
121 | {
122 | completionHandler(.allow)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:119:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:119:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:119:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:255:58: error: cannot find type 'URLRequest' in scope
253 | }
254 |
255 | private func updateLastUpdatedFromRequest(_ request: URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
256 | // Extract the lastUpdatedAt from the updatedAt header
257 | if let lastUpdatedAt = request.allHTTPHeaderFields?["x-flagsmith-document-updated-at"] {
/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/Router.swift:88:72: error: cannot find type 'URLRequest' in scope
86 | func request(baseUrl: URL,
87 | apiKey: String,
88 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
89 | {
90 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/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
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[13/27] Compiling FlagsmithClient Flagsmith+Concurrency.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: value of type '_' expected to be instance of class or class-constrained type
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:270:47: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
268 | }
269 |
270 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
271 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
272 |
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:336:1: error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
334 | // MARK: - HTTPURLResponse Extensions
335 |
336 | extension HTTPURLResponse {
| `- error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
337 | static let dateFormatter: DateFormatter = {
338 | let formatter = DateFormatter()
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:23: error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
569 |
570 | /// 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 |
71 | override init() {
/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 |
71 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:221:23: error: cannot find 'URLRequest' in scope
219 |
220 | // Create request for general flags
221 | let request = URLRequest(url: baseURL.appendingPathComponent("flags/"))
| `- error: cannot find 'URLRequest' in scope
222 |
223 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:224:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
222 |
223 | // Check if we have a cached response
224 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
225 | // Check if cache is still valid based on TTL
226 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:251:23: error: cannot find 'URLRequest' in scope
249 |
250 | guard let url = components.url else { return nil }
251 | let request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 |
253 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:254:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
252 |
253 | // Check if we have a cached response
254 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
255 | // Check if cache is still valid based on TTL
256 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:271:49: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
269 |
270 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
271 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
272 |
273 | // Check if we have a cache control header
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:283:47: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
281 | // Check if cache is still valid based on max-age
282 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
283 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
284 | let age = Date().timeIntervalSince(date)
285 | return age < maxAge
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:293:43: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
291 | if cacheConfig.cacheTTL > 0 {
292 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
293 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
294 | let age = Date().timeIntervalSince(date)
295 | return age < cacheConfig.cacheTTL
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:530:35: error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
528 | if lastUpdatedAt < event.updatedAt {
529 | // Evict everything fron the cache
530 | cacheConfig.cache.removeAllCachedResponses()
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
531 |
532 | // 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>
[14/27] Compiling FlagsmithClient Flagsmith.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: value of type '_' expected to be instance of class or class-constrained type
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:270:47: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
268 | }
269 |
270 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
271 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
272 |
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:336:1: error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
334 | // MARK: - HTTPURLResponse Extensions
335 |
336 | extension HTTPURLResponse {
| `- error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
337 | static let dateFormatter: DateFormatter = {
338 | let formatter = DateFormatter()
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:23: error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
569 |
570 | /// 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 |
71 | override init() {
/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 |
71 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:221:23: error: cannot find 'URLRequest' in scope
219 |
220 | // Create request for general flags
221 | let request = URLRequest(url: baseURL.appendingPathComponent("flags/"))
| `- error: cannot find 'URLRequest' in scope
222 |
223 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:224:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
222 |
223 | // Check if we have a cached response
224 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
225 | // Check if cache is still valid based on TTL
226 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:251:23: error: cannot find 'URLRequest' in scope
249 |
250 | guard let url = components.url else { return nil }
251 | let request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 |
253 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:254:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
252 |
253 | // Check if we have a cached response
254 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
255 | // Check if cache is still valid based on TTL
256 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:271:49: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
269 |
270 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
271 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
272 |
273 | // Check if we have a cache control header
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:283:47: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
281 | // Check if cache is still valid based on max-age
282 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
283 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
284 | let age = Date().timeIntervalSince(date)
285 | return age < maxAge
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:293:43: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
291 | if cacheConfig.cacheTTL > 0 {
292 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
293 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
294 | let age = Date().timeIntervalSince(date)
295 | return age < cacheConfig.cacheTTL
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:530:35: error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
528 | if lastUpdatedAt < event.updatedAt {
529 | // Evict everything fron the cache
530 | cacheConfig.cache.removeAllCachedResponses()
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
531 |
532 | // 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>
[15/27] Compiling FlagsmithClient FlagsmithError.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: value of type '_' expected to be instance of class or class-constrained type
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: value of type '_' expected to be instance of class or class-constrained type
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:35: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
569 |
570 | /// Use cached flags as a fallback?
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:270:47: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
268 | }
269 |
270 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
271 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
272 |
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:336:1: error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
334 | // MARK: - HTTPURLResponse Extensions
335 |
336 | extension HTTPURLResponse {
| `- error: non-nominal type 'HTTPURLResponse' (aka 'AnyObject') cannot be extended [#NominalTypes]
337 | static let dateFormatter: DateFormatter = {
338 | let formatter = DateFormatter()
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:568:23: error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
566 | public final class CacheConfig {
567 | /// Cache to use when enabled, defaults to the shared app cache
568 | public var cache: URLCache = .shared
| `- error: 'URLCache' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
569 |
570 | /// 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 |
71 | override init() {
/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 |
71 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:221:23: error: cannot find 'URLRequest' in scope
219 |
220 | // Create request for general flags
221 | let request = URLRequest(url: baseURL.appendingPathComponent("flags/"))
| `- error: cannot find 'URLRequest' in scope
222 |
223 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:224:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
222 |
223 | // Check if we have a cached response
224 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
225 | // Check if cache is still valid based on TTL
226 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:251:23: error: cannot find 'URLRequest' in scope
249 |
250 | guard let url = components.url else { return nil }
251 | let request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
252 |
253 | // Check if we have a cached response
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:254:39: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
252 |
253 | // Check if we have a cached response
254 | if let cachedResponse = cache.cachedResponse(for: request) {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
255 | // Check if cache is still valid based on TTL
256 | if isCacheValid(cachedResponse: cachedResponse) {
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:271:49: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
269 |
270 | private func isCacheValid(cachedResponse: CachedURLResponse) -> Bool {
271 | guard let httpResponse = cachedResponse.response as? HTTPURLResponse else { return false }
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
272 |
273 | // Check if we have a cache control header
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:283:47: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
281 | // Check if cache is still valid based on max-age
282 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
283 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
284 | let age = Date().timeIntervalSince(date)
285 | return age < maxAge
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:293:43: error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
291 | if cacheConfig.cacheTTL > 0 {
292 | if let dateString = httpResponse.allHeaderFields["Date"] as? String,
293 | let date = HTTPURLResponse.dateFormatter.date(from: dateString) {
| `- error: type 'HTTPURLResponse' (aka 'AnyObject') has no member 'dateFormatter'
294 | let age = Date().timeIntervalSince(date)
295 | return age < cacheConfig.cacheTTL
/host/spi-builder-workspace/FlagsmithClient/Classes/Flagsmith.swift:530:35: error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
528 | if lastUpdatedAt < event.updatedAt {
529 | // Evict everything fron the cache
530 | cacheConfig.cache.removeAllCachedResponses()
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'removeAllCachedResponses'
531 |
532 | // 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>
[16/27] Compiling FlagsmithClient Traits.swift
[17/27] Compiling FlagsmithClient TypedValue.swift
[18/27] Compiling FlagsmithClient ReconnectionDelay.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:88:72: error: cannot find type 'URLRequest' in scope
86 | func request(baseUrl: URL,
87 | apiKey: String,
88 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
89 | {
90 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:103:23: error: cannot find 'URLRequest' in scope
101 | }
102 |
103 | var request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
104 | request.httpMethod = method.rawValue
105 | if let body = try body(using: encoder) {
[19/27] Compiling FlagsmithClient Router.swift
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:88:72: error: cannot find type 'URLRequest' in scope
86 | func request(baseUrl: URL,
87 | apiKey: String,
88 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
89 | {
90 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:103:23: error: cannot find 'URLRequest' in scope
101 | }
102 |
103 | var request = URLRequest(url: url)
| `- error: cannot find 'URLRequest' in scope
104 | request.httpMethod = method.rawValue
105 | if let body = try body(using: encoder) {
[20/27] 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 | }
[21/27] 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 | }
[22/27] 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 |
71 | override init() {
/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 |
71 | override init() {
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[23/27] 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 |
71 | override init() {
/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 |
71 | override init() {
[#NominalTypes]: <https://docs.swift.org/compiler/documentation/diagnostics/nominal-types>
[24/27] 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 |
/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 |
/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 |
71 | override init() {
/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 |
71 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:79:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
77 | }
78 |
79 | 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.
80 | serialAccessQueue.sync {
81 | 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:79:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
77 | }
78 |
79 | 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.
80 | serialAccessQueue.sync {
81 | 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:96:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:96:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:96:104: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:97:61: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
95 |
96 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
98 | {
99 | 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:111:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 | }
110 |
111 | 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.
112 | serialAccessQueue.sync {
113 | 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:111:46: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 | }
110 |
111 | 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.
112 | serialAccessQueue.sync {
113 | 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:120:62: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
118 |
119 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
121 | {
122 | completionHandler(.allow)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:119:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:119:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:119:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:255:58: error: cannot find type 'URLRequest' in scope
253 | }
254 |
255 | private func updateLastUpdatedFromRequest(_ request: URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
256 | // Extract the lastUpdatedAt from the updatedAt header
257 | 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:73:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
71 | override init() {
72 | super.init()
73 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:75:43: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
73 | let configuration = URLSessionConfiguration.default
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
76 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
77 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:76:91: error: cannot find 'OperationQueue' in scope
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
76 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
77 | }
78 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:76:19: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
76 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
77 | }
78 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:84:25: error: cannot find 'DispatchQueue' in scope
82 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
83 | if let error = error {
84 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
| `- error: cannot find 'DispatchQueue' in scope
85 | } else {
86 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:87:25: error: cannot find 'DispatchQueue' in scope
85 | } else {
86 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
87 | DispatchQueue.main.async { completion(.success(data)) }
| `- error: cannot find 'DispatchQueue' in scope
88 | }
89 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:36: warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
79 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
80 | serialAccessQueue.sync {
81 | if let dataTask = task as? URLSessionDataTask {
| `- warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
82 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
83 | if let error = error {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:82:72: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
80 | serialAccessQueue.sync {
81 | if let dataTask = task as? URLSessionDataTask {
82 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
83 | if let error = error {
84 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:103:17: error: cannot find 'DispatchQueue' in scope
101 | if Flagsmith.shared.cacheConfig.useCache {
102 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
103 | DispatchQueue.main.async { completionHandler(newResponse) }
| `- error: cannot find 'DispatchQueue' in scope
104 | } else {
105 | // When caching is disabled, don't cache the response
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:106:17: error: cannot find 'DispatchQueue' in scope
104 | } else {
105 | // When caching is disabled, don't cache the response
106 | DispatchQueue.main.async { completionHandler(nil) }
| `- error: cannot find 'DispatchQueue' in scope
107 | }
108 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:102:52: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
100 | // intercept and modify the cache settings for the response
101 | if Flagsmith.shared.cacheConfig.useCache {
102 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
103 | DispatchQueue.main.async { completionHandler(newResponse) }
104 | } else {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:53: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
111 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
112 | serialAccessQueue.sync {
113 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
114 | existingData.append(data)
115 | tasksToData[dataTask.taskIdentifier] = existingData
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:122:28: error: cannot infer contextual base in reference to member 'allow'
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
122 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
123 | }
124 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:137:22: error: cannot find type 'URLRequest' in scope
135 | }
136 |
137 | var request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
138 | do {
139 | request = try router.request(baseUrl: baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:88:72: error: cannot find type 'URLRequest' in scope
86 | func request(baseUrl: URL,
87 | apiKey: String,
88 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
89 | {
90 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:146:32: error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
144 |
145 | // set the cache policy based on Flagsmith settings
146 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
| `- error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
147 | if Flagsmith.shared.cacheConfig.useCache {
148 | request.cachePolicy = .useProtocolCachePolicy
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:148:36: error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
146 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
147 | if Flagsmith.shared.cacheConfig.useCache {
148 | request.cachePolicy = .useProtocolCachePolicy
| `- error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
149 | if Flagsmith.shared.cacheConfig.skipAPI {
150 | request.cachePolicy = .returnCacheDataElseLoad
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:150:40: error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
148 | request.cachePolicy = .useProtocolCachePolicy
149 | if Flagsmith.shared.cacheConfig.skipAPI {
150 | request.cachePolicy = .returnCacheDataElseLoad
| `- error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
151 | }
152 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:160:99: error: cannot find 'OperationQueue' in scope
158 | let configuration = URLSessionConfiguration.default
159 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
160 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
161 | }
162 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:157:24: error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
155 | serialAccessQueue.sync {
156 | // Update session cache configuration if it has changed (must be done inside the serial queue)
157 | if session.configuration.urlCache !== Flagsmith.shared.cacheConfig.cache {
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
158 | let configuration = URLSessionConfiguration.default
159 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:197:17: warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
195 | switch result {
196 | case let .failure(error):
197 | 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]
198 | case let .success(data):
199 | do {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:224:51: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
222 |
223 | // Check if response is already cached
224 | if Flagsmith.shared.cacheConfig.cache.cachedResponse(for: request) != nil {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
225 | return // Already cached
226 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:229:32: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
227 |
228 | // Create a cacheable response
229 | let httpResponse = HTTPURLResponse(
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
230 | url: request.url!,
231 | statusCode: 200,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:239:34: error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
237 | )!
238 |
239 | let cachedResponse = CachedURLResponse(
| `- error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
240 | response: httpResponse,
241 | data: data,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:242:27: error: 'nil' requires a contextual type
240 | response: httpResponse,
241 | data: data,
242 | userInfo: nil,
| `- error: 'nil' requires a contextual type
243 | storagePolicy: .allowed
244 | )
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:243:33: error: cannot infer contextual base in reference to member 'allowed'
241 | data: data,
242 | userInfo: nil,
243 | storagePolicy: .allowed
| `- error: cannot infer contextual base in reference to member 'allowed'
244 | )
245 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:247:48: error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
245 |
246 | // Store the response in cache
247 | Flagsmith.shared.cacheConfig.cache.storeCachedResponse(cachedResponse, for: request)
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
248 |
249 | } catch {
[#SendableMetatypes]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-metatypes>
[25/27] 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 |
/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 |
/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 |
71 | override init() {
/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 |
71 | override init() {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:79:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
77 | }
78 |
79 | 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.
80 | serialAccessQueue.sync {
81 | 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:79:42: error: 'URLSessionTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
77 | }
78 |
79 | 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.
80 | serialAccessQueue.sync {
81 | 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:96:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:96:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:96:104: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
94 | }
95 |
96 | 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.
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
98 | {
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:97:61: error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
95 |
96 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, willCacheResponse proposedResponse: CachedURLResponse,
97 | completionHandler: @Sendable @escaping (CachedURLResponse?) -> Void)
| `- error: 'CachedURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
98 | {
99 | 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:111:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 | }
110 |
111 | 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.
112 | serialAccessQueue.sync {
113 | 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:111:46: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 | }
110 |
111 | 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.
112 | serialAccessQueue.sync {
113 | 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:120:62: error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
118 |
119 | func urlSession(_: URLSession, dataTask _: URLSessionDataTask, didReceive _: URLResponse,
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
| `- error: 'ResponseDisposition' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
121 | {
122 | completionHandler(.allow)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:119:24: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:119:48: error: 'URLSessionDataTask' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:119:82: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 | }
118 |
119 | 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.
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
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:255:58: error: cannot find type 'URLRequest' in scope
253 | }
254 |
255 | private func updateLastUpdatedFromRequest(_ request: URLRequest) {
| `- error: cannot find type 'URLRequest' in scope
256 | // Extract the lastUpdatedAt from the updatedAt header
257 | 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:73:53: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
71 | override init() {
72 | super.init()
73 | let configuration = URLSessionConfiguration.default
| `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:75:43: error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
73 | let configuration = URLSessionConfiguration.default
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
| `- error: type 'URLCache' (aka 'AnyObject') has no member 'shared'
76 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
77 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:76:91: error: cannot find 'OperationQueue' in scope
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
76 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
77 | }
78 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:76:19: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
74 | // Set initial cache configuration - this will be updated when cache settings change
75 | configuration.urlCache = URLCache.shared
76 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
77 | }
78 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:84:25: error: cannot find 'DispatchQueue' in scope
82 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
83 | if let error = error {
84 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
| `- error: cannot find 'DispatchQueue' in scope
85 | } else {
86 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:87:25: error: cannot find 'DispatchQueue' in scope
85 | } else {
86 | let data = tasksToData[dataTask.taskIdentifier] ?? Data()
87 | DispatchQueue.main.async { completion(.success(data)) }
| `- error: cannot find 'DispatchQueue' in scope
88 | }
89 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:81:36: warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
79 | func urlSession(_: URLSession, task: URLSessionTask, didCompleteWithError error: (any Error)?) {
80 | serialAccessQueue.sync {
81 | if let dataTask = task as? URLSessionDataTask {
| `- warning: conditional cast from 'URLSessionTask' (aka 'AnyObject') to 'URLSessionDataTask' (aka 'AnyObject') always succeeds
82 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
83 | if let error = error {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:82:72: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
80 | serialAccessQueue.sync {
81 | if let dataTask = task as? URLSessionDataTask {
82 | if let completion = tasksToCompletionHandlers[dataTask.taskIdentifier] {
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
83 | if let error = error {
84 | DispatchQueue.main.async { completion(.failure(FlagsmithError.unhandled(error))) }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:103:17: error: cannot find 'DispatchQueue' in scope
101 | if Flagsmith.shared.cacheConfig.useCache {
102 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
103 | DispatchQueue.main.async { completionHandler(newResponse) }
| `- error: cannot find 'DispatchQueue' in scope
104 | } else {
105 | // When caching is disabled, don't cache the response
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:106:17: error: cannot find 'DispatchQueue' in scope
104 | } else {
105 | // When caching is disabled, don't cache the response
106 | DispatchQueue.main.async { completionHandler(nil) }
| `- error: cannot find 'DispatchQueue' in scope
107 | }
108 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:102:52: error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
100 | // intercept and modify the cache settings for the response
101 | if Flagsmith.shared.cacheConfig.useCache {
102 | let newResponse = proposedResponse.response(withExpirationDuration: Int(Flagsmith.shared.cacheConfig.cacheTTL))
| `- error: value of type 'CachedURLResponse' (aka 'AnyObject') has no member 'response'
103 | DispatchQueue.main.async { completionHandler(newResponse) }
104 | } else {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:113:53: error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
111 | func urlSession(_: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
112 | serialAccessQueue.sync {
113 | var existingData = tasksToData[dataTask.taskIdentifier] ?? Data()
| `- error: value of type 'URLSessionDataTask' (aka 'AnyObject') has no member 'taskIdentifier'
114 | existingData.append(data)
115 | tasksToData[dataTask.taskIdentifier] = existingData
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:122:28: error: cannot infer contextual base in reference to member 'allow'
120 | completionHandler: @escaping (URLSession.ResponseDisposition) -> Void)
121 | {
122 | completionHandler(.allow)
| `- error: cannot infer contextual base in reference to member 'allow'
123 | }
124 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:137:22: error: cannot find type 'URLRequest' in scope
135 | }
136 |
137 | var request: URLRequest
| `- error: cannot find type 'URLRequest' in scope
138 | do {
139 | request = try router.request(baseUrl: baseURL, apiKey: apiKey)
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/Router.swift:88:72: error: cannot find type 'URLRequest' in scope
86 | func request(baseUrl: URL,
87 | apiKey: String,
88 | using encoder: JSONEncoder = JSONEncoder()) throws -> URLRequest
| `- error: cannot find type 'URLRequest' in scope
89 | {
90 | let urlString = baseUrl.appendingPathComponent(path).absoluteString
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:146:32: error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
144 |
145 | // set the cache policy based on Flagsmith settings
146 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
| `- error: cannot infer contextual base in reference to member 'reloadIgnoringLocalAndRemoteCacheData'
147 | if Flagsmith.shared.cacheConfig.useCache {
148 | request.cachePolicy = .useProtocolCachePolicy
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:148:36: error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
146 | request.cachePolicy = .reloadIgnoringLocalAndRemoteCacheData
147 | if Flagsmith.shared.cacheConfig.useCache {
148 | request.cachePolicy = .useProtocolCachePolicy
| `- error: cannot infer contextual base in reference to member 'useProtocolCachePolicy'
149 | if Flagsmith.shared.cacheConfig.skipAPI {
150 | request.cachePolicy = .returnCacheDataElseLoad
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:150:40: error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
148 | request.cachePolicy = .useProtocolCachePolicy
149 | if Flagsmith.shared.cacheConfig.skipAPI {
150 | request.cachePolicy = .returnCacheDataElseLoad
| `- error: cannot infer contextual base in reference to member 'returnCacheDataElseLoad'
151 | }
152 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:160:99: error: cannot find 'OperationQueue' in scope
158 | let configuration = URLSessionConfiguration.default
159 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
160 | session = URLSession(configuration: configuration, delegate: self, delegateQueue: OperationQueue.main)
| `- error: cannot find 'OperationQueue' in scope
161 | }
162 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:157:24: error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
155 | serialAccessQueue.sync {
156 | // Update session cache configuration if it has changed (must be done inside the serial queue)
157 | if session.configuration.urlCache !== Flagsmith.shared.cacheConfig.cache {
| `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'configuration'
158 | let configuration = URLSessionConfiguration.default
159 | configuration.urlCache = Flagsmith.shared.cacheConfig.cache
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:197:17: warning: capture of non-Sendable type 'T.Type' in an isolated closure; this is an error in the Swift 6 language mode [#SendableMetatypes]
195 | switch result {
196 | case let .failure(error):
197 | 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]
198 | case let .success(data):
199 | do {
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:224:51: error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
222 |
223 | // Check if response is already cached
224 | if Flagsmith.shared.cacheConfig.cache.cachedResponse(for: request) != nil {
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'cachedResponse'
225 | return // Already cached
226 | }
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:229:32: error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
227 |
228 | // Create a cacheable response
229 | let httpResponse = HTTPURLResponse(
| `- error: 'HTTPURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
230 | url: request.url!,
231 | statusCode: 200,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:239:34: error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
237 | )!
238 |
239 | let cachedResponse = CachedURLResponse(
| `- error: 'CachedURLResponse' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
240 | response: httpResponse,
241 | data: data,
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:242:27: error: 'nil' requires a contextual type
240 | response: httpResponse,
241 | data: data,
242 | userInfo: nil,
| `- error: 'nil' requires a contextual type
243 | storagePolicy: .allowed
244 | )
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:243:33: error: cannot infer contextual base in reference to member 'allowed'
241 | data: data,
242 | userInfo: nil,
243 | storagePolicy: .allowed
| `- error: cannot infer contextual base in reference to member 'allowed'
244 | )
245 |
/host/spi-builder-workspace/FlagsmithClient/Classes/Internal/APIManager.swift:247:48: error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
245 |
246 | // Store the response in cache
247 | Flagsmith.shared.cacheConfig.cache.storeCachedResponse(cachedResponse, for: request)
| `- error: value of type 'URLCache' (aka 'AnyObject') has no member 'storeCachedResponse'
248 |
249 | } catch {
[#SendableMetatypes]: <https://docs.swift.org/compiler/documentation/diagnostics/sendable-metatypes>
[26/27] Compiling FlagsmithClient UnknownTypeValue.swift
[27/27] Compiling FlagsmithClient resource_bundle_accessor.swift
BUILD FAILURE 6.2 wasm