Closed philviso-reverb closed 3 years ago
I found a few problems with this issue:
@philviso-reverb Thanks for the bug report and investigation.
@christibbs Please review the referenced change from #5890
@philviso-reverb Sorry for the delay. Just added #7269 which I assume is identical to your PR!
Thanks for the update! Yep, that's identical to what I did.
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
Since we upgraded from 6.18.0 to 7.0.0, we're seeing RemoteConfig log "Experiment payload could not be parsed as JSON." a bunch of times. I didn't count, but it's probably being logged once for each of our experiments. The result of this is that our A/B tests seem to have completely stopped getting updated values from the server.
Steps to reproduce:
It's easy to reproduce in
RCNConfigExperiement.testLoadExperimentFromTable
if you add an additional assertion to verify that the payloads were handled properly...That assertion will fail before the fix and succeeds after the fix (see below)
Relevant Code:
I looked around in the
FirebaseRemoteConfig
source code and pinned down the issue (I have a PR ready to go as well).As part of the change in this pull request (https://github.com/firebase/firebase-ios-sdk/pull/5890/files)
RCNConfigExperiment.m
changed how it did JSON validation from...to...
isValidJSONObject
is meant to receive anNSArray
orNSDictionary
to test if that collection can be converted into JSON data (source). Passing it data causes it to return false every time. The previous implementation is the correct way to test ifNSData
can be converted to JSON.