Can't setup fetchTimeout on RemoteConfigSettings
Description
Firebase doesn't use fetchTimeout settings. Looks like he setup it, but doesn't use
Reproducing the issue
Setup IPhone internet connection Go to Settings -> Developer -> Network Link Conditioner -> 100% Loss
Setup FirebaseApp
public init() {
if FirebaseApp.app() == nil {
FirebaseApp.configure()
}
let settings = RemoteConfigSettings()
settings.minimumFetchInterval = 2 * 60 * 60
settings.fetchTimeout = 30
remoteConfig = .remoteConfig()
remoteConfig.configSettings = settings
super.init()
Messaging.messaging().delegate = self
Use fetchRemoteConfig:
func fetchRemoteConfigurationPayload(
) -> AnyPublisher<RemoteConfigurationPayload, Never> {
let remoteConfig = self
return Future<ConfigurationFetchPayload, Never> { [remoteConfig] promise in
remoteConfig.fetch { status, error in
....
And if we will use prints inside Future fuction we will receive correct FetchTimeout
print("SETTINGS FETCHTIMEOUT =>", remoteConfig.configSettings.fetchTimeout)
But in real - Firebase still use 1 minuted timeOut
Firebase SDK Version
11.1.0
Xcode Version
16.0
Installation Method
Swift Package Manager
Firebase Product(s)
Remote Config
Targeted Platforms
iOS
Relevant Log Output
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Thanks for reporting, @MaksimBezdrobnoi. Upon testing, the issue is only reproducible when the app is just installed without internet connection. May I know if this is the same behavior you did to reproduce the issue?
Same scenario is occurring on my side On the very first opening RemoteConfig handler never call back. User has to kill and then reopen the app.
@rizafran Yes, it only reproduces when the app is just installed. It makes sense, but interesting why it can't use my fetchTimeout from the start (when the app has just been installed)
Thanks for confirming, @MaksimBezdrobnoi. I'll raise it to our engineers to see if it's a bug or intended.
I have the same issue, the same 11.1.0 version but Xcode 15.4
Hi there, I believe I solved the issue after being able to reproduce it. The line remoteConfig = .remoteConfig() was overwriting the existing global instance, resetting your settings. I fixed it by ensuring the existing instance is configured directly, so your changes are applied consistently. it should ideally just look like this:
let settings = RemoteConfigSettings()
settings.minimumFetchInterval = 2 * 60 * 60
settings.fetchTimeout = 30
remoteConfig.configSettings = settings
In my test case, I used 30 in fetchTimeout and using Network Link Conditioner on 100% loss and the print statements came back with 30 being used.
I also wrapped it into a setupDefaults() function that I called after FirebaseApp.configure(). Please let me know if this fixes it for you!
Hey @MaksimBezdrobnoi. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!