You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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...
RCNConfigExperiment.m changed how it did JSON validation from...
NSError *error;
id experimentPayloadJSON = [NSJSONSerializationJSONObjectWithData:experiment options:kNilOptionserror:&error];
if (!experimentPayloadJSON || error) {
to...
if (![NSJSONSerializationisValidJSONObject:experiment]) {
isValidJSONObject is meant to receive an NSArray or NSDictionary 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 if NSData can be converted to JSON.
The text was updated successfully, but these errors were encountered:
[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...XCTAssertEqualObjects(_payloadsData, _configExperiment.experimentPayloads);
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.The text was updated successfully, but these errors were encountered: