firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.41k stars 1.43k forks source link

Remote Config not producing throttling error accurately #12435

Open aj2109 opened 4 months ago

aj2109 commented 4 months ago

Description

In trying to add non fatal logging specifically for throttling I have discovered what appears to be a bug. Whilst the error status of the connection is 429, as shown in the logs, and the catch let error as RemoteConfig hitting, its error code is never that of throttling (8002), its always internal errors code (8003). (minimumFetchInterval = 0 seconds btw)

Thanks!

Reproducing the issue

func forceThrottle() async {
        let RemoteConfig = RemoteConfig.remoteConfg()
       do {
       for i in 0...1000 {
          let foo = try await remoteConfig.fetchAndActivate()
       }
       } catch let error as RemoteConfigError {
       //prints false
           print("Error code is correct: \(error.code == .throttled)")
       } catch {}
}

Firebase SDK Version

10.21.0

Xcode Version

15.2

Installation Method

Swift Package Manager

Firebase Product(s)

AB Testing, Analytics, App Distribution, Crashlytics, Performance, Remote Config

Targeted Platforms

iOS

Relevant Log Output

10.21.0 - [FirebaseRemoteConfig][I-RCN000026] RCN fetch failure. Response http error code: 429

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

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

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 4 months ago

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

rizafran commented 4 months ago

Thanks for reporting, @aj2109. I tried to reproduce the issue and I was able to get the same error code (8003). I'll be raising this to our engineers to investigate.

paulb777 commented 4 months ago

Internally tracked at b/327637888