feat(openfeature): include RUM user in evaluation context - #1363
Open
btthomas wants to merge 4 commits into
Open
feat(openfeature): include RUM user in evaluation context#1363btthomas wants to merge 4 commits into
btthomas wants to merge 4 commits into
Conversation
1 task
btthomas
marked this pull request as ready for review
August 7, 2026 15:32
btthomas
requested review from
pavlokhrebto and
vjfridge
and removed request for
a team
August 7, 2026 15:32
There was a problem hiding this comment.
Pull request overview
This PR enriches the online Datadog OpenFeature provider’s evaluation context with the current RUM user (id/name/email + flat primitive extraInfo), aligning React Native behavior with the browser SDK and ensuring the same effective context is used for both assignment fetching and evaluation tracking.
Changes:
- Add a core helper to enrich OpenFeature-shaped contexts with the current RUM user (and expose it for the OpenFeature package while keeping compatibility with older core versions).
- Update the online OpenFeature provider to apply RUM enrichment during
initializeandonContextChange(context reconciliation). - Add unit + integration coverage and document RUM-user context behavior and reconciliation guidance.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react-native-openfeature/src/provider.ts | Applies optional core-provided RUM context enrichment before mapping to Datadog evaluation context. |
| packages/react-native-openfeature/src/tests/provider.test.ts | Adds unit tests verifying enrichment is applied on initialize and on context change. |
| packages/react-native-openfeature/src/tests/provider.integration.test.ts | Adds integration tests validating enriched context is used for fetch + tracking and respects rumIntegrationEnabled: false. |
| packages/react-native-openfeature/src/tests/provider.compatibility.test.ts | Ensures behavior is preserved when running against older core versions without the enrichment helper. |
| packages/react-native-openfeature/README.md | Documents how RUM user defaults affect OpenFeature context and how to reconcile after user changes. |
| packages/core/src/index.tsx | Exposes the enrichment helper via an internal __ddEnrichEvaluationContextWithRumUser export. |
| packages/core/src/flags/types.ts | Updates rumIntegrationEnabled documentation to include OpenFeature context enrichment behavior. |
| packages/core/src/flags/rumIntegration.ts | Implements RUM-user-to-context enrichment logic (id → targetingKey; name/email/flat primitive extraInfo → attributes). |
| packages/core/src/flags/DdFlags.ts | Wires rumIntegrationEnabled configuration into the enrichment helper’s runtime behavior. |
| packages/core/src/flags/tests/rumIntegration.test.ts | Adds unit tests for enrichment semantics and opt-out behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+59
to
+62
| return { | ||
| ...Object.fromEntries(rumContextEntries), | ||
| ...context | ||
| } as T; |
janine-c
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Use the current RUM user as default OpenFeature evaluation context for the online Datadog provider, matching the browser SDK behavior from DataDog/openfeature-js-client#354 and the shared client contract being documented in DataDog/documentation#39000.
targetingKeyname,email, and flat primitiveextraInfovalues to evaluation attributesundefinedOpenFeature fields as tombstones that suppress the corresponding RUM default and are omitted from the effective contextrumIntegrationEnabled: falseThis is implemented entirely in the JavaScript/TypeScript packages; no Android or iOS SDK changes are needed.
Acceptance plan
undefinedOpenFeature fields remove inherited RUM values before fetching, evaluation, and tracking.Validation
yarn exec jest --watchman=false --runInBand --projects packages/core packages/react-native-openfeaturegit diff --checkpassed.OfflineProvider integration plan
After completing this code pass, I reviewed the in-progress dynamic OfflineProvider stack: #1346, #1347, #1348, plus the context-semantics work in #1359.
Recommended integration with that stack:
develop, then rebase the dynamic-rules stack onto the updateddevelop.rumIntegrationEnabledopt-out.This lets the shared RUM-context behavior land first without changing current offline/precomputed semantics. The dynamic OfflineProvider stack can then consume it specifically for server-SDK-style multi-user local rules evaluation.