File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,13 @@ extension Installations: InstallationsProtocol {}
107107
108108 /// Provide fetchSession for tests to override.
109109 /// - Note: Managed internally by the fetch instance.
110- public var fetchSession : any RCNConfigFetchSession
110+ private var fetchSession : any RCNConfigFetchSession
111+
112+ public var configuredFetchSessionProvider : ( ConfigSettings ) -> RCNConfigFetchSession {
113+ didSet {
114+ fetchSession = configuredFetchSessionProvider ( settings)
115+ }
116+ }
111117
112118 private let namespace : String
113119
@@ -138,8 +144,6 @@ extension Installations: InstallationsProtocol {}
138144 )
139145 }
140146
141- private let configuredFetchSessionProvider : ( ConfigSettings ) -> RCNConfigFetchSession
142-
143147 /// Designated initializer
144148 @objc public init ( content: ConfigContent ,
145149 DBManager: ConfigDBManager ,
@@ -180,13 +184,8 @@ extension Installations: InstallationsProtocol {}
180184 super. init ( )
181185 }
182186
183- public var disableNetworkSessionRecreation : Bool = false
184-
185187 /// Add the ability to update NSURLSession's timeout after a session has already been created.
186188 @objc public func recreateNetworkSession( ) {
187- if disableNetworkSessionRecreation {
188- return
189- }
190189 fetchSession. invalidateAndCancel ( )
191190 fetchSession = configuredFetchSessionProvider ( settings)
192191 }
Original file line number Diff line number Diff line change @@ -98,8 +98,9 @@ class APITestBase: XCTestCase {
9898 config. configRealtime = RealtimeMocks . mockRealtime ( config. configRealtime)
9999 }
100100 fakeConsole = FakeConsole ( )
101- config. configFetch. fetchSession = URLSessionMock ( with: fakeConsole)
102- config. configFetch. disableNetworkSessionRecreation = true
101+ config. configFetch. configuredFetchSessionProvider = { _ in
102+ URLSessionMock ( with: self . fakeConsole)
103+ }
103104
104105 fakeConsole. config = [ Constants . key1: Constants . value1,
105106 Constants . jsonKey: jsonValue,
You can’t perform that action at this time.
0 commit comments