Firebase-ios-sdk: Simultaneous Remote Config fetch is not allowed any more

Created on 9 Sep 2019  路  14Comments  路  Source: firebase/firebase-ios-sdk

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to __the code in this repository__
    file a Github issue.

    • If this is a __feature request__ make sure the issue title starts with "FR:".

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 10.2.1 Build version 10E1001
  • Firebase SDK version: 6.4.0
  • Firebase Component: Remote Config
  • Component version: 6.4.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Our application uses heavily Remote Config. One important case is when new user launches application for the first time. Upon app startup we request Remote Config to serve the right content tailored for the user. However, during that initial fetch we might learn (as async callback) about user premium status or that his coming from some ad campaign. This is important information and so we need to fetch Remote Config with updated user properties which significantly changes what should be served.

When we used 5.20.2 version we just simply request another Remote Config fetch and it was handled in parallel to the initial one. We discarded 1st RC fetch and continue app execution with what we received from 2nd RC fetch.

However, since we updated Firebase to 6.4.0 our logic is no longer valid since we are getting errors:

Error Domain=com.google.remoteconfig.ErrorDomain Code=-114 "(null)" UserInfo={FetchError=Duplicate request while the previous one is pending})

Does this mean that simultaneous Remote Config fetch are not allowed any more?

If that's the case, it sounds like we need a way to cancel Remote Config fetch in order to correctly fetch when one is ongoing (we submitted feature request: Case 00003839: Cancel ongoing Remote Config fetch).

Based on our research, when we hit the aforementioned error, the 2nd RC fetch is just ignored, so our app ends up with results from initial fetch.

remoteconfig

All 14 comments

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

Hi, disabling duplicate requests has been by design, and might not have been working properly in the previous version. For your purpose, looks like you can do the following:

  1. Set the minimumFetchInterval to 0.
  2. In the fetch completion handler, initiate a second fetch call to update the user properties.

Please reopen if this does not work for you.

It still happens on version 6.7.0.

Latest Firebase release is 6.8.1

I update now, and the problem remains. Log:
app[246:5058] 6.8.1 - [Firebase/RemoteConfig][I-RCN000053] A fetch is already in progress. Ignoring duplicate request.

@josevictor1 Did you see the comment above?

Hi, disabling duplicate requests has been by design, and might not have been working properly in the previous version. For your purpose, looks like you can do the following:

  1. Set the minimumFetchInterval to 0.
  2. In the fetch completion handler, initiate a second fetch call to update the user properties.

Please reopen if this does not work for you.

Is this one? So I've tried this solution but still not working. @paulb777

Same for me, Firebase (6.9.0) and FirebaseFirestore (1.5.1). I still have the Error Domain=com.google.remoteconfig.ErrorDomain Code=-114 "(null)" UserInfo={FetchError=Duplicate request while the previous one is pending}) :/

Can either of you repro this issue in the remote config sample?

@josevictor1 can you elaborate what is not working for you? You should not be seeing "Duplicate request.." if you are making the second fetch call after the completion of the first fetch call.

@dmandar I'm getting the same error as @titopalito. Optional(Error Domain=com.google.remoteconfig.ErrorDomain Code=-114 "(null)" UserInfo={FetchError=Duplicate request while the previous one is pending}).

About the second fetch call after the completion:

remoteConfig.fetchAndActivate(completionHandler: { (status, error) in
             remoteConfig.fetch(withExpirationDuration: 5) { (status, error) in

            }
  })

I've tried this, but still not working.

Thanks @josevictor1 for confirming. Investigating.

hi guys, i have same error message. spend hours and still not solved.

any advices how to solve that error?

Hi..can folks test once fix #4844 is out in the next release of Firebase? Also, to reiterate, if any second follow-up fetch request needs to be made, it needs to happen only in the completion handler of the first request.

Was this page helpful?
0 / 5 - 0 ratings