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,13 +107,7 @@ extension Installations: InstallationsProtocol {}
107107
108108 /// Provide fetchSession for tests to override.
109109 /// - Note: Managed internally by the fetch instance.
110- private var fetchSession : any RCNConfigFetchSession
111-
112- public var configuredFetchSessionProvider : ( ConfigSettings ) -> RCNConfigFetchSession {
113- didSet {
114- fetchSession = configuredFetchSessionProvider ( settings)
115- }
116- }
110+ public var fetchSession : any RCNConfigFetchSession
117111
118112 private let namespace : String
119113
@@ -144,6 +138,8 @@ extension Installations: InstallationsProtocol {}
144138 )
145139 }
146140
141+ private let configuredFetchSessionProvider : ( ConfigSettings ) -> RCNConfigFetchSession
142+
147143 /// Designated initializer
148144 @objc public init ( content: ConfigContent ,
149145 DBManager: ConfigDBManager ,
@@ -184,8 +180,13 @@ extension Installations: InstallationsProtocol {}
184180 super. init ( )
185181 }
186182
183+ public var disableNetworkSessionRecreation : Bool = false
184+
187185 /// Add the ability to update NSURLSession's timeout after a session has already been created.
188186 @objc public func recreateNetworkSession( ) {
187+ if disableNetworkSessionRecreation {
188+ return
189+ }
189190 fetchSession. invalidateAndCancel ( )
190191 fetchSession = configuredFetchSessionProvider ( settings)
191192 }
Original file line number Diff line number Diff line change @@ -98,9 +98,8 @@ class APITestBase: XCTestCase {
9898 config. configRealtime = RealtimeMocks . mockRealtime ( config. configRealtime)
9999 }
100100 fakeConsole = FakeConsole ( )
101- config. configFetch. configuredFetchSessionProvider = { _ in
102- URLSessionMock ( with: self . fakeConsole)
103- }
101+ config. configFetch. fetchSession = URLSessionMock ( with: fakeConsole)
102+ config. configFetch. disableNetworkSessionRecreation = true
104103
105104 fakeConsole. config = [ Constants . key1: Constants . value1,
106105 Constants . jsonKey: jsonValue,
You can’t perform that action at this time.
0 commit comments