Skip to content

Implement Experiment Metadata Tracking for Realtime Config Updates#15976

Open
tusharkhandelwal8 wants to merge 11 commits intomainfrom
abt-realtime
Open

Implement Experiment Metadata Tracking for Realtime Config Updates#15976
tusharkhandelwal8 wants to merge 11 commits intomainfrom
abt-realtime

Conversation

@tusharkhandelwal8
Copy link
Copy Markdown
Contributor

@tusharkhandelwal8 tusharkhandelwal8 commented Mar 25, 2026

This PR introduces experiment metadata tracking to the Remote Config Realtime Service. Previously, onConfigUpdate was only triggered if a parameter's value changed. With this change, the SDK now detects changes in A/B test assignments (experiments/variants) for specific parameters, even if their values remain identical.

Key Changes:

  • Experiment Mapping: Added createExperimentsMap to pivot raw experiment data into a lookup table where config keys are the primary index.
  • Enhanced Diffing: Updated the change detection logic in RCNConfigContent to compare active vs fetched experiment metadata using the affectedParameterKeys field.
  • Asynchronous Safety: Integrated waitForDatabaseOperationQueue to ensure experiment payloads are fully loaded from the disk before performing diffing logic.

Validation / Testing Scenarios:

  • Add/Remove Experiment: Verified that adding or removing an experiment from a config key flags that key as changed.
  • Replace Experiment: Verified that switching a key from one experiment/variant to another triggers an update.
  • New Parameter: Verified that a brand new parameter with an attached experiment is correctly identified as a changed key.
  • Value Persistence: Confirmed that a change in variantId triggers an update even if the parameter value (e.g., "hello world") stays the same.

Testing on Sample iOS App: Link

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@tusharkhandelwal8 tusharkhandelwal8 marked this pull request as ready for review March 27, 2026 05:30
Copy link
Copy Markdown

@ashish-kothari ashish-kothari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m
@paulb777
Copy link
Copy Markdown
Member

Please address the CI failures

Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m Outdated
@ncooke3
Copy link
Copy Markdown
Member

ncooke3 commented Apr 1, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements logic to trigger Remote Config Realtime updates when experiment or variant assignments change. It introduces methods to load experiment payloads from the database, map them to configuration keys, and identify keys affected by changes in experiment metadata. Unit tests were added to verify these changes. Feedback suggests adding type safety checks when parsing experiment JSON to prevent crashes, using unionSet: for more concise set merging, and correcting an encoding constant in the test suite.

Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m Outdated
Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m Outdated
Comment thread FirebaseRemoteConfig/Tests/Unit/RCNConfigContentTest.m Outdated
Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m Outdated
Comment thread FirebaseRemoteConfig/CHANGELOG.md Outdated
Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m
Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m
Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m
Comment thread FirebaseRemoteConfig/Sources/RCNConfigContent.m Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants