Skip to content

remote config realtime listener frequently cannot fetch current version of the template #11462

@mikehardy

Description

@mikehardy

Description

In wrapping the realtime remote config feature for react-native-firebase I have noticed that the iOS SDK frequently generates this error:

 AssertionError: error {"code":"config_update_not_fetched","message":"Unable to fetch the latest version of the template..","nativeErrorMessage":"Unable to fetch the latest version of the template.."}

This does not happen in the same tests using the near-identical firebase-android-sdk APIs

Reproducing the issue

1- create a cloud function that uses the firebase-admin-sdk to alter a remote config template (like perhaps this one https://github.com/invertase/react-native-firebase/blob/feat%2Fremote-config-onconfigupdated/.github/workflows/scripts/functions/src/testFunctionRemoteConfigUpdate.ts) and wraps that behind a POST API

2- create a test that adds an SDK listener for realtime remoteconfig changes

3- post to your cloud function to update the template

4- repeat 3 until it fails here:

NSError *error = [NSError errorWithDomain:FIRRemoteConfigUpdateErrorDomain
code:FIRRemoteConfigUpdateErrorNotFetched
userInfo:@{
NSLocalizedDescriptionKey :
@"Unable to fetch the latest version of the template."
}];

Does the iOS SDK have different tunings with regard to retry intervals / retry count vs firebase-android-sdk? It's curious that I'm coming close to 100+ trials now and android has never had this while on iOS I see it maybe 10% of the time.

As a follow-on, I'm not sure how I can work around this at the react-native-firebase level, or what to prescribe to our users if this happens. Should they attempt to use directly / manually fetch the new config template? Will that potentially run into caching or throttling issues vs the realtime updates?

Firebase SDK Version

10.11.0

Xcode Version

14.3.1

Installation Method

CocoaPods

Firebase Product(s)

Remote Config

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions