Skip to content

FFL-1460 FlagsClient changes to accommodate Flags RN SDK sync flag evals#3049

Merged
dd-mergequeue[bot] merged 27 commits intodevelopfrom
dima/FFL-1460-sync-flag-evaluation-in-rn-sdk
Jan 6, 2026
Merged

FFL-1460 FlagsClient changes to accommodate Flags RN SDK sync flag evals#3049
dd-mergequeue[bot] merged 27 commits intodevelopfrom
dima/FFL-1460-sync-flag-evaluation-in-rn-sdk

Conversation

@yugisu-flux
Copy link
Copy Markdown
Contributor

@yugisu-flux yugisu-flux commented Dec 11, 2025

What does this PR do?

This PR introduces new exposed "internal" APIs supporting the upcoming Flags SDK for React Native.

Changes:

  • New "internal" method for retrieving a snapshot of all precomputed flags to FlagsClient
  • New "internal" method for tracking a flag evaluation within a certain EvaluationContext
  • Add a _FlagsInternalProxy class for FlagsClient
  • Add an UnparsedFlag interface to prevent PrecomputedFlag from being exposed to the public

"internal" APIs = exposed APIs that are added purely for consumption within the RN SDK. This implementation follows the example of _RumInternalProxy.

Motivation

The motivation for this work is to allow the upcoming Flags RN SDK to retrieve the complete feature flags state snapshot from the JS side at SDK init time (FFL-1460).

Additional Notes

I've been developing these changes using the example application in the dd-sdk-reactnative repo (by leveraging composite builds)

Sibling PRs in the React Native and iOS repos:

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@yugisu-flux yugisu-flux force-pushed the dima/FFL-1460-sync-flag-evaluation-in-rn-sdk branch from f3efb76 to ca508fe Compare December 11, 2025 18:01
@yugisu-flux yugisu-flux requested review from 0xnm and typotter December 15, 2025 18:48
@yugisu-flux yugisu-flux requested a review from 0xnm December 16, 2025 13:34
Copy link
Copy Markdown
Member

@0xnm 0xnm left a comment

Choose a reason for hiding this comment

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

I added some suggestions, nothing blocking, mostly about API/logging. I think it is a final round and we are good to go after.

Comment thread features/dd-sdk-android-flags/api/apiSurface Outdated
val errorMessage = "Failed to parse value '${flag.variationValue}' as JSONObject - ${exception.message}"
featureSdkCore.internalLogger.log(
InternalLogger.Level.WARN,
InternalLogger.Target.MAINTAINER,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should the target be the USER? Since I guess it is about user data parsing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This log is corresponding to the flags data parsing logic in readAndParseAssignment (line 289).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My point here is that MAINTAINER target logs are visible only in the SDK debug builds, they won't be shown in the release build. So if user needs to know about this error, it should be USER target.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@typotter FYI the target has been changed to USER in other related flag value parsing logic as well. Does that work for you?

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Dec 16, 2025

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 66.45% (-0.11%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0046c64 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 73.46939% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.55%. Comparing base (70ecc68) to head (0046c64).
⚠️ Report is 822 commits behind head on develop.

Files with missing lines Patch % Lines
...n/com/datadog/android/flags/_FlagsInternalProxy.kt 0.00% 7 Missing ⚠️
...lags/internal/repository/DefaultFlagsRepository.kt 33.33% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3049      +/-   ##
===========================================
+ Coverage    71.46%   71.55%   +0.09%     
===========================================
  Files          880      881       +1     
  Lines        32480    32544      +64     
  Branches      5473     5481       +8     
===========================================
+ Hits         23211    23286      +75     
- Misses        7728     7739      +11     
+ Partials      1541     1519      -22     
Files with missing lines Coverage Δ
...tadog/android/flags/internal/DatadogFlagsClient.kt 92.50% <100.00%> (+1.20%) ⬆️
.../android/flags/internal/ExposureEventsProcessor.kt 100.00% <ø> (ø)
...og/android/flags/internal/model/PrecomputedFlag.kt 100.00% <100.00%> (ø)
...lags/internal/repository/DefaultFlagsRepository.kt 60.00% <33.33%> (-4.71%) ⬇️
...n/com/datadog/android/flags/_FlagsInternalProxy.kt 0.00% <0.00%> (ø)

... and 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yugisu-flux yugisu-flux requested review from 0xnm and typotter January 5, 2026 14:36
0xnm
0xnm previously approved these changes Jan 5, 2026
typotter
typotter previously approved these changes Jan 5, 2026
Copy link
Copy Markdown
Contributor

@typotter typotter left a comment

Choose a reason for hiding this comment

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

lgtm, approved.
Just a suggestion but nothing blocking from ffe. 🚢

flag.variationValue
}
else -> null
val variationTypeToKClass = mapOf(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this could be a static constant instead of being redefined everytime the function runs.

@yugisu-flux yugisu-flux dismissed stale reviews from typotter and 0xnm via ed7f053 January 5, 2026 16:48
typotter
typotter previously approved these changes Jan 5, 2026
0xnm
0xnm previously approved these changes Jan 5, 2026
@yugisu-flux yugisu-flux dismissed stale reviews from 0xnm and typotter via 834914f January 6, 2026 11:19
0xnm
0xnm previously approved these changes Jan 6, 2026
@yugisu-flux
Copy link
Copy Markdown
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex Bot commented Jan 6, 2026

View all feedbacks in Devflow UI.

2026-01-06 15:49:13 UTC ℹ️ Start processing command /merge


2026-01-06 15:49:48 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in develop is approximately 57m (p90).


2026-01-06 16:54:23 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue Bot merged commit d370277 into develop Jan 6, 2026
27 of 30 checks passed
@dd-mergequeue dd-mergequeue Bot deleted the dima/FFL-1460-sync-flag-evaluation-in-rn-sdk branch January 6, 2026 16:54
@0xnm 0xnm restored the dima/FFL-1460-sync-flag-evaluation-in-rn-sdk branch March 26, 2026 10:49
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